diff options
| author | Brian Carlstrom <bdc@google.com> | 2010-04-09 16:29:17 -0700 |
|---|---|---|
| committer | Brian Carlstrom <bdc@google.com> | 2010-04-15 10:36:05 -0700 |
| commit | 90218acfdf94283de53db4a4d6f9bea2dd447290 (patch) | |
| tree | e28ef01a695856d607ff6a8bd35ea477fe1ea788 /testrunner/test_defs | |
| parent | 39884388ede417af1186dd2605142554f4796d95 (diff) | |
| download | android_development-90218acfdf94283de53db4a4d6f9bea2dd447290.tar.gz android_development-90218acfdf94283de53db4a4d6f9bea2dd447290.tar.bz2 android_development-90218acfdf94283de53db4a4d6f9bea2dd447290.zip | |
runtest --path fails with symlinked ANDROID_BUILD_TOP
While reproducing b/2558977 I found that "runtest --path" did not work
for me because my ANDROID_BUILD_TOP contained a symlink. This is a
local fix to make FindTests use os.path.realpath instead of only half
using os.path.abspath when trying to make canonical paths to compare.
Change-Id: Ief353f52cb80b1798edc3c1233d1e082d9cebc26
Diffstat (limited to 'testrunner/test_defs')
| -rwxr-xr-x | testrunner/test_defs/test_walker.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testrunner/test_defs/test_walker.py b/testrunner/test_defs/test_walker.py index 06c4e6d5a..948d53e78 100755 --- a/testrunner/test_defs/test_walker.py +++ b/testrunner/test_defs/test_walker.py @@ -65,20 +65,20 @@ class TestWalker(object): if not os.path.exists(path): logger.Log('%s does not exist' % path) return [] - abspath = os.path.abspath(path) + realpath = os.path.realpath(path) # ensure path is in ANDROID_BUILD_ROOT - self._build_top = android_build.GetTop() - if not self._IsPathInBuildTree(abspath): + self._build_top = os.path.realpath(android_build.GetTop()) + if not self._IsPathInBuildTree(realpath): logger.Log('%s is not a sub-directory of build root %s' % (path, self._build_top)) return [] # first, assume path is a parent directory, which specifies to run all # tests within this directory - tests = self._FindSubTests(abspath, []) + tests = self._FindSubTests(realpath, []) if not tests: logger.SilentLog('No tests found within %s, searching upwards' % path) - tests = self._FindUpstreamTests(abspath) + tests = self._FindUpstreamTests(realpath) return tests def _IsPathInBuildTree(self, path): |
