[GTK] Parse Valgrind xml leak files
authorbrian.holt@samsung.com <brian.holt@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 18:30:12 +0000 (18:30 +0000)
committerbrian.holt@samsung.com <brian.holt@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jan 2014 18:30:12 +0000 (18:30 +0000)
commit0284dcdc8e32757d59adb3255e4a17c0ab2de37c
tree0d9755859e5a038b6919d427c848f2b5e48dcc0a
parentbc81ef518cf8a66e7552216d54b6c3143f0f82c2
[GTK] Parse Valgrind xml leak files
https://bugs.webkit.org/show_bug.cgi?id=119446

Reviewed by Alejandro G. Castro.

Parse the xml files generated by Valgrind to yield useful
information about the memory leaks.

* Scripts/webkitpy/port/gtk.py:
(GtkPort.__init__):
(GtkPort.setup_test_run): Clear the previous output files before new
run.
(GtkPort.print_leaks_summary):

* Scripts/webkitpy/port/leakdetector_valgrind.py: Added.
Parse the xml files generated by Valgrind and summarise leaks
into an easily understandable list.
(get_text_of):
(get_CDATA_of):
(gather_frames):
(ValgrindError):
(ValgrindError.__init__):
(ValgrindError.__str__):
(ValgrindError.unique_string):
(ValgrindError.error_hash):
(ValgrindError.__hash__):
(ValgrindError.__eq__):
(LeakDetectorValgrind):
(LeakDetectorValgrind.__init__):
(LeakDetectorValgrind._parse_leaks_output):
(LeakDetectorValgrind.leaks_files_in_results_directory):
(LeakDetectorValgrind.clean_leaks_files_from_results_directory):
(LeakDetectorValgrind.parse_and_print_leaks_detail):

* Scripts/webkitpy/port/leakdetector_valgrind_unittest.py: Added.
(make_mock_valgrind_output):
(make_mock_incomplete_valgrind_output):
(make_mock_valgrind_results):
(make_mock_valgrind_results_incomplete):
(make_mock_valgrind_results_empty):
(make_mock_valgrind_results_misformatted):
(LeakDetectorValgrindTest):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_pass):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_incomplete):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_empty):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_misformatted):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_pass):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_incomplete):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_empty):
(LeakDetectorValgrindTest.test_parse_and_print_leaks_detail_misformatted):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/webkitpy/port/gtk.py
Tools/Scripts/webkitpy/port/leakdetector_valgrind.py [new file with mode: 0644]
Tools/Scripts/webkitpy/port/leakdetector_valgrind_unittest.py [new file with mode: 0644]