Skip to content

Commit

Permalink
Use os.path.realpath when tracking the cwd.
Browse files Browse the repository at this point in the history
This is needed by TestCases/Posix/coverage-direct.cc

The problem is that the test does:

mkdir <dir>
cd <dir>
cd ..
rm -rf <dir>
<more commands>

the current directory currently looks like "/.../<dir>/../" 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
  • Loading branch information
espindola committed Mar 30, 2017
1 parent c1e48aa commit 62aabaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/lit/lit/TestRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 62aabaa

Please sign in to comment.