Remove runtest dependency on current dir being build top.

This change is necessary to support relative path based args.
This commit is contained in:
Brett Chabot
2009-10-21 20:01:31 -07:00
parent 1cd6174130
commit e00595bdbe
2 changed files with 6 additions and 1 deletions

View File

@@ -221,7 +221,10 @@ class TestRunner(object):
self._options.make_jobs) self._options.make_jobs)
logger.Log(cmd) logger.Log(cmd)
if not self._options.preview: if not self._options.preview:
old_dir = os.getcwd()
os.chdir(self._root_path)
run_command.RunCommand(cmd, return_output=False) run_command.RunCommand(cmd, return_output=False)
os.chdir(old_dir)
target_build_string = " ".join(list(target_set)) target_build_string = " ".join(list(target_set))
extra_args_string = " ".join(list(extra_args_set)) extra_args_string = " ".join(list(extra_args_set))
# mmm cannot be used from python, so perform a similar operation using # 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)): if os.path.isfile(os.path.join(self._root_path, build_file_path)):
target_set.add(build_file_path) target_set.add(build_file_path)
return True return True
else:
logger.Log("%s has no Android.mk, skipping" % build_dir)
return False return False
def _GetTestsToRun(self): def _GetTestsToRun(self):

View File

@@ -52,7 +52,7 @@ class NativeTestSuite(test_suite.AbstractTestSuite):
# find all test files, convert unicode names to ascii, take the basename # find all test files, convert unicode names to ascii, take the basename
# and drop the .cc/.cpp extension. # and drop the .cc/.cpp extension.
source_list = [] 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) os.path.walk(build_path, self._CollectTestSources, source_list)
logger.SilentLog("Tests source %s" % source_list) logger.SilentLog("Tests source %s" % source_list)