From: Rafael Espindola Date: Thu, 30 Mar 2017 21:05:31 +0000 (+0000) Subject: Use os.path.realpath when tracking the cwd. X-Git-Tag: android-x86-7.1-r4~18324 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=62aabaa87dbe9261ba97012e6c1aefe0d343e314;p=android-x86%2Fexternal-llvm.git Use os.path.realpath when tracking the cwd. This is needed by TestCases/Posix/coverage-direct.cc The problem is that the test does: mkdir cd cd .. rm -rf the current directory currently looks like "/...//../" which doesn't exist when dir is deleted. at some point we should probably switch to using the os current directory (specially if we want to add subshell), but this is a small incremental improvement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299113 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index 894159ee7bf..2e6c37c0f31 100644 --- a/utils/lit/lit/TestRunner.py +++ b/utils/lit/lit/TestRunner.py @@ -252,7 +252,7 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper): if os.path.isabs(newdir): shenv.cwd = newdir else: - shenv.cwd = os.path.join(shenv.cwd, newdir) + shenv.cwd = os.path.realpath(os.path.join(shenv.cwd, newdir)) # The cd builtin always succeeds. If the directory does not exist, the # following Popen calls will fail instead. return 0