Commit 71b7492d authored by carlosgc@webkit.org's avatar carlosgc@webkit.org

[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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 92012cf4
2013-08-26 Carlos Garcia Campos <cgarcia@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 <cgarcia@igalia.com>
[GTK] Improve the stop/reload button implementation in MiniBrowser
......
......@@ -97,21 +97,33 @@ class TestRunner:
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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment