From e00595bdbe62793778744ecaf4e95981d50724c6 Mon Sep 17 00:00:00 2001 From: Brett Chabot Date: Wed, 21 Oct 2009 20:01:31 -0700 Subject: [PATCH] Remove runtest dependency on current dir being build top. This change is necessary to support relative path based args. --- testrunner/runtest.py | 5 +++++ testrunner/test_defs/native_test.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/testrunner/runtest.py b/testrunner/runtest.py index e637b714e..b6938cdbc 100755 --- a/testrunner/runtest.py +++ b/testrunner/runtest.py @@ -221,7 +221,10 @@ class TestRunner(object): self._options.make_jobs) logger.Log(cmd) if not self._options.preview: + old_dir = os.getcwd() + os.chdir(self._root_path) run_command.RunCommand(cmd, return_output=False) + os.chdir(old_dir) target_build_string = " ".join(list(target_set)) extra_args_string = " ".join(list(extra_args_set)) # mmm cannot be used from python, so perform a similar operation using @@ -253,6 +256,8 @@ class TestRunner(object): if os.path.isfile(os.path.join(self._root_path, build_file_path)): target_set.add(build_file_path) return True + else: + logger.Log("%s has no Android.mk, skipping" % build_dir) return False def _GetTestsToRun(self): diff --git a/testrunner/test_defs/native_test.py b/testrunner/test_defs/native_test.py index ad7352a6a..e6917c9e3 100644 --- a/testrunner/test_defs/native_test.py +++ b/testrunner/test_defs/native_test.py @@ -52,7 +52,7 @@ class NativeTestSuite(test_suite.AbstractTestSuite): # find all test files, convert unicode names to ascii, take the basename # and drop the .cc/.cpp extension. source_list = [] - build_path = self.GetBuildPath() + build_path = os.path.join(android_build.GetTop(), self.GetBuildPath()) os.path.walk(build_path, self._CollectTestSources, source_list) logger.SilentLog("Tests source %s" % source_list)