diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2013-08-29 02:52:10 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-29 02:52:10 +0000 |
| commit | b8da61fd1b864678c3a0b4ea0b00cfb06166e078 (patch) | |
| tree | 45db224b485adc4a4e2eb9b6513a0cf0edb42c1a | |
| parent | 6c77e726598b57a7d59c2461cf408b197c7b34e5 (diff) | |
| download | bcm5719-llvm-b8da61fd1b864678c3a0b4ea0b00cfb06166e078.tar.gz bcm5719-llvm-b8da61fd1b864678c3a0b4ea0b00cfb06166e078.zip | |
[lit] Fix internal shell's argv[0] handling.
- At least on OS X, it is important for correct behavior of /bin/[ that argv[0]
is passed as written, and not as the full executable path.
llvm-svn: 189559
| -rw-r--r-- | llvm/utils/lit/lit/TestRunner.py | 5 | ||||
| -rw-r--r-- | llvm/utils/lit/tests/shtest-format.py | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py index 120f89a21a4..97524179988 100644 --- a/llvm/utils/lit/lit/TestRunner.py +++ b/llvm/utils/lit/lit/TestRunner.py @@ -131,8 +131,8 @@ def executeShCmd(cmd, cfg, cwd, results): # Resolve the executable path ourselves. args = list(j.args) - args[0] = lit.util.which(args[0], cfg.environment['PATH']) - if not args[0]: + executable = lit.util.which(args[0], cfg.environment['PATH']) + if not executable: raise InternalShellError(j, '%r: command not found' % j.args[0]) # Replace uses of /dev/null with temporary files. @@ -145,6 +145,7 @@ def executeShCmd(cmd, cfg, cwd, results): args[i] = f.name procs.append(subprocess.Popen(args, cwd=cwd, + executable = executable, stdin = stdin, stdout = stdout, stderr = stderr, diff --git a/llvm/utils/lit/tests/shtest-format.py b/llvm/utils/lit/tests/shtest-format.py index 1c23119e8b8..751f0d70803 100644 --- a/llvm/utils/lit/tests/shtest-format.py +++ b/llvm/utils/lit/tests/shtest-format.py @@ -7,6 +7,7 @@ # CHECK: -- Testing: +# CHECK: PASS: shtest-format :: argv0.txt # CHECK: FAIL: shtest-format :: external_shell/fail.txt # CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED *** # CHECK: Command Output (stdout): @@ -68,7 +69,7 @@ # CHECK: shtest-format :: external_shell/fail_with_bad_encoding.txt # CHECK: shtest-format :: fail.txt -# CHECK: Expected Passes : 3 +# CHECK: Expected Passes : 4 # CHECK: Expected Failures : 3 # CHECK: Unsupported Tests : 2 # CHECK: Unresolved Tests : 1 |

