Title: [100912] trunk/Tools
- Revision
- 100912
- Author
- [email protected]
- Date
- 2011-11-21 07:15:44 -0800 (Mon, 21 Nov 2011)
Log Message
Make NRWT consider all lines of output from parse-malloc-history, not just the first
Fixes <http://webkit.org/b/72652> REGRESSION (NRWT): NRWT always reports "1 unique leaks
found" even when there are more than 1 unique leaks
Reviewed by Darin Adler.
* Scripts/webkitpy/layout_tests/port/leakdetector.py:
(LeakDetector.count_total_bytes_and_unique_leaks): Pass re.MULTILINE to re.findall so that
"^" will be considered to match the beginning of any line, not only the beginning of the
string.
* Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py:
(LeakDetectorTest.test_count_total_bytes_and_unique_leaks): Added a second callstack to the
fake output and updated expectations to match.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (100911 => 100912)
--- trunk/Tools/ChangeLog 2011-11-21 15:04:09 UTC (rev 100911)
+++ trunk/Tools/ChangeLog 2011-11-21 15:15:44 UTC (rev 100912)
@@ -1,3 +1,21 @@
+2011-11-18 Adam Roben <[email protected]>
+
+ Make NRWT consider all lines of output from parse-malloc-history, not just the first
+
+ Fixes <http://webkit.org/b/72652> REGRESSION (NRWT): NRWT always reports "1 unique leaks
+ found" even when there are more than 1 unique leaks
+
+ Reviewed by Darin Adler.
+
+ * Scripts/webkitpy/layout_tests/port/leakdetector.py:
+ (LeakDetector.count_total_bytes_and_unique_leaks): Pass re.MULTILINE to re.findall so that
+ "^" will be considered to match the beginning of any line, not only the beginning of the
+ string.
+
+ * Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py:
+ (LeakDetectorTest.test_count_total_bytes_and_unique_leaks): Added a second callstack to the
+ fake output and updated expectations to match.
+
2011-11-21 Andras Becsi <[email protected]>
[Qt] Clean up MiniBrowser project file after recent changes
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py (100911 => 100912)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py 2011-11-21 15:04:09 UTC (rev 100911)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py 2011-11-21 15:15:44 UTC (rev 100912)
@@ -121,7 +121,7 @@
return
# total: 5,888 bytes (0 bytes excluded).
- unique_leak_count = len(re.findall(r'^(\d*)\scalls', parse_malloc_history_output))
+ unique_leak_count = len(re.findall(r'^(\d*)\scalls', parse_malloc_history_output, re.MULTILINE))
total_bytes_string = re.search(r'^total\:\s(.+)\s\(', parse_malloc_history_output, re.MULTILINE).group(1)
return (total_bytes_string, unique_leak_count)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py (100911 => 100912)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py 2011-11-21 15:04:09 UTC (rev 100911)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py 2011-11-21 15:15:44 UTC (rev 100912)
@@ -130,13 +130,15 @@
print "MOCK _run_script: %s %s" % (name, args)
return """1 calls for 16 bytes: -[NSURLRequest mutableCopyWithZone:] | +[NSObject(NSObject) allocWithZone:] | _internal_class_createInstanceFromZone | calloc | malloc_zone_calloc
+147 calls for 9,408 bytes: _CFRuntimeCreateInstance | _ZN3WTF24StringWrapperCFAllocatorL8allocateElmPv StringImplCF.cpp:67 | WTF::fastMalloc(unsigned long) FastMalloc.cpp:268 | malloc | malloc_zone_malloc
+
total: 5,888 bytes (0 bytes excluded)."""
detector._port._run_script = mock_run_script
leak_files = ['/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-1235-leaks.txt']
expected_stdout = "MOCK _run_script: parse-malloc-history ['--merge-depth', 5, '/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-1235-leaks.txt']\n"
results_tuple = OutputCapture().assert_outputs(self, detector.count_total_bytes_and_unique_leaks, [leak_files], expected_stdout=expected_stdout)
- self.assertEquals(results_tuple, ("5,888 bytes", 1))
+ self.assertEquals(results_tuple, ("5,888 bytes", 2))
def test_count_total_leaks(self):
detector = self._make_detector()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes