diff options
| author | Brett Chabot <brettchabot@android.com> | 2011-06-06 20:53:56 -0700 |
|---|---|---|
| committer | Brett Chabot <brettchabot@android.com> | 2011-06-07 08:27:36 -0700 |
| commit | 3c9cefc70f7c05e7dcfd494116b96b802113b46a (patch) | |
| tree | 6bc892ba3418a610d5377d1eb4934a8566bfa99f /testrunner | |
| parent | 98ff2036ecd5372e7ce33ece53138cd2ca55e128 (diff) | |
| download | android_development-3c9cefc70f7c05e7dcfd494116b96b802113b46a.tar.gz android_development-3c9cefc70f7c05e7dcfd494116b96b802113b46a.tar.bz2 android_development-3c9cefc70f7c05e7dcfd494116b96b802113b46a.zip | |
Remove runtest hard dependency on test_defs.xml files.
Previously runtest would fail hard if development/test_runner/test_defs.xml
file was not present, even if it wasn't needed (ie running in --path mode).
This commit skips test_defs parsing if --path is specified, and only parses
development/test_runner/test_defs.xml if its present.
Bug 4556556
Change-Id: Ief2dbbdab5c7e82e5db64414392d6e2a564e815d
Diffstat (limited to 'testrunner')
| -rwxr-xr-x | testrunner/runtest.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/testrunner/runtest.py b/testrunner/runtest.py index 19102c668..3ecc77b22 100755 --- a/testrunner/runtest.py +++ b/testrunner/runtest.py @@ -195,18 +195,21 @@ class TestRunner(object): Raises: AbortError: If a fatal error occurred when parsing the tests. """ - core_test_path = os.path.join(self._root_path, self._CORE_TEST_PATH) try: known_tests = test_defs.TestDefinitions() - known_tests.Parse(core_test_path) - # read all <android root>/vendor/*/tests/testinfo/test_defs.xml paths - vendor_tests_pattern = os.path.join(self._root_path, - self._VENDOR_TEST_PATH) - test_file_paths = glob.glob(vendor_tests_pattern) - for test_file_path in test_file_paths: - known_tests.Parse(test_file_path) - if os.path.isfile(self._options.user_tests_file): - known_tests.Parse(self._options.user_tests_file) + # only read tests when not in path mode + if not self._options.test_path: + core_test_path = os.path.join(self._root_path, self._CORE_TEST_PATH) + if os.path.isfile(core_test_path): + known_tests.Parse(core_test_path) + # read all <android root>/vendor/*/tests/testinfo/test_defs.xml paths + vendor_tests_pattern = os.path.join(self._root_path, + self._VENDOR_TEST_PATH) + test_file_paths = glob.glob(vendor_tests_pattern) + for test_file_path in test_file_paths: + known_tests.Parse(test_file_path) + if os.path.isfile(self._options.user_tests_file): + known_tests.Parse(self._options.user_tests_file) return known_tests except errors.ParseError: raise errors.AbortError |
