Title: [154595] trunk/Tools
Revision
154595
Author
carlo...@webkit.org
Date
2013-08-26 03:36:03 -0700 (Mon, 26 Aug 2013)

Log Message

[GTK] Add support for passing test directories to run-gtk-tests
https://bugs.webkit.org/show_bug.cgi?id=120296

Reviewed by Philippe Normand.

* Scripts/run-gtk-tests:
(TestRunner._get_tests_from_dir): Helper function to return all
unit tests found in a given directory.
(TestRunner._get_tests): Check the given tests passed in the
command line, so that if a directory is found the tests contained
in the directory are added to the list of tests to run.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (154594 => 154595)


--- trunk/Tools/ChangeLog	2013-08-26 10:31:35 UTC (rev 154594)
+++ trunk/Tools/ChangeLog	2013-08-26 10:36:03 UTC (rev 154595)
@@ -1,5 +1,19 @@
 2013-08-26  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        [GTK] Add support for passing test directories to run-gtk-tests
+        https://bugs.webkit.org/show_bug.cgi?id=120296
+
+        Reviewed by Philippe Normand.
+
+        * Scripts/run-gtk-tests:
+        (TestRunner._get_tests_from_dir): Helper function to return all
+        unit tests found in a given directory.
+        (TestRunner._get_tests): Check the given tests passed in the
+        command line, so that if a directory is found the tests contained
+        in the directory are added to the list of tests to run.
+
+2013-08-26  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [GTK] Improve the stop/reload button implementation in MiniBrowser
         https://bugs.webkit.org/show_bug.cgi?id=120292
 

Modified: trunk/Tools/Scripts/run-gtk-tests (154594 => 154595)


--- trunk/Tools/Scripts/run-gtk-tests	2013-08-26 10:31:35 UTC (rev 154594)
+++ trunk/Tools/Scripts/run-gtk-tests	2013-08-26 10:36:03 UTC (rev 154595)
@@ -97,21 +97,33 @@
         self._spi_registryd = None
         self._spi_bus_launcher = None
 
-    def _get_tests(self, tests):
+    def _get_tests_from_dir(self, test_dir):
+        if not os.path.isdir(test_dir):
+            return []
+
+        tests = []
+        for test_file in os.listdir(test_dir):
+            if not test_file.lower().startswith("test"):
+                continue
+            test_path = os.path.join(test_dir, test_file)
+            if os.path.isfile(test_path) and os.access(test_path, os.X_OK):
+                tests.append(test_path)
+        return tests
+
+    def _get_tests(self, initial_tests):
+        tests = []
+        for test in initial_tests:
+            if os.path.isdir(test):
+                tests.extend(self._get_tests_from_dir(test))
+            else:
+                tests.append(test)
         if tests:
             return tests
 
         tests = []
         for test_dir in self.TEST_DIRS:
             absolute_test_dir = os.path.join(self._programs_path, test_dir)
-            if not os.path.isdir(absolute_test_dir):
-                continue
-            for test_file in os.listdir(absolute_test_dir):
-                if not test_file.lower().startswith("test"):
-                    continue
-                test_path = os.path.join(self._programs_path, test_dir, test_file)
-                if os.path.isfile(test_path) and os.access(test_path, os.X_OK):
-                    tests.append(test_path)
+            tests.extend(self._get_tests_from_dir(absolute_test_dir))
         return tests
 
     def _lookup_atspi2_binary(self, filename):
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to