Title: [107053] trunk/Tools
Revision
107053
Author
rn...@webkit.org
Date
2012-02-08 01:51:14 -0800 (Wed, 08 Feb 2012)

Log Message

run-perf-tests doesn't recognize paths that start with PerformanceTests
https://bugs.webkit.org/show_bug.cgi?id=78012

Reviewed by Adam Barth.

Use resolve paths using filesystem.relpath before passing it to find_files.find.

* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner):
(PerfTestsRunner._collect_tests):
* Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
(test_collect_tests):
(test_collect_tests.add_file):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (107052 => 107053)


--- trunk/Tools/ChangeLog	2012-02-08 09:17:27 UTC (rev 107052)
+++ trunk/Tools/ChangeLog	2012-02-08 09:51:14 UTC (rev 107053)
@@ -1,3 +1,19 @@
+2012-02-07  Ryosuke Niwa  <rn...@webkit.org>
+
+        run-perf-tests doesn't recognize paths that start with PerformanceTests
+        https://bugs.webkit.org/show_bug.cgi?id=78012
+
+        Reviewed by Adam Barth.
+
+        Use resolve paths using filesystem.relpath before passing it to find_files.find.
+
+        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+        (PerfTestsRunner):
+        (PerfTestsRunner._collect_tests):
+        * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
+        (test_collect_tests):
+        (test_collect_tests.add_file):
+
 2012-02-07  Justin Novosad  <ju...@chromium.org>
 
         [Chromium] add option for 2d canvas defered rendering to DumpRenderTree

Modified: trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py (107052 => 107053)


--- trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py	2012-02-08 09:17:27 UTC (rev 107052)
+++ trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py	2012-02-08 09:51:14 UTC (rev 107053)
@@ -46,7 +46,6 @@
 
 
 class PerfTestsRunner(object):
-    _perf_tests_base_dir = 'PerformanceTests'
     _test_directories_for_chromium_style_tests = ['inspector']
     _default_branch = 'webkit-trunk'
     _EXIT_CODE_BAD_BUILD = -1
@@ -107,8 +106,15 @@
         def _is_test_file(filesystem, dirname, filename):
             return filename.endswith('.html')
 
+        paths = []
+        for arg in self._args:
+            paths.append(arg)
+            relpath = self._host.filesystem.relpath(arg, self._base_path)
+            if relpath:
+                paths.append(relpath)
+
         skipped_directories = set(['.svn', 'resources'])
-        tests = find_files.find(self._host.filesystem, self._base_path, self._args, skipped_directories, _is_test_file)
+        tests = find_files.find(self._host.filesystem, self._base_path, paths, skipped_directories, _is_test_file)
         return [test for test in tests if not self._port.skips_perf_test(self._port.relative_perf_test_filename(test))]
 
     def run(self):

Modified: trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py (107052 => 107053)


--- trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py	2012-02-08 09:17:27 UTC (rev 107052)
+++ trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py	2012-02-08 09:51:14 UTC (rev 107053)
@@ -307,6 +307,19 @@
         tests = runner._collect_tests()
         self.assertEqual(len(tests), 1)
 
+    def test_collect_tests(self):
+        runner = self.create_runner(args=['PerformanceTests/test1.html', 'test2.html'])
+
+        def add_file(filename):
+            runner._host.filesystem.files[runner._host.filesystem.join(runner._base_path, filename)] = 'some content'
+
+        add_file('test1.html')
+        add_file('test2.html')
+        add_file('test3.html')
+        runner._host.filesystem.chdir(runner._port.webkit_base())
+        tests = [runner._port.relative_perf_test_filename(test) for test in runner._collect_tests()]
+        self.assertEqual(sorted(tests), ['test1.html', 'test2.html'])
+
     def test_collect_tests_with_skipped_list(self):
         runner = self.create_runner()
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to