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
This commit is contained in:
@@ -195,9 +195,12 @@ 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()
|
||||
# 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,
|
||||
|
||||
Reference in New Issue
Block a user