llvm.org GIT mirror llvm / cb4bfb3
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189559 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 6 years ago
2 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
130130
131131 # Resolve the executable path ourselves.
132132 args = list(j.args)
133 args[0] = lit.util.which(args[0], cfg.environment['PATH'])
134 if not args[0]:
133 executable = lit.util.which(args[0], cfg.environment['PATH'])
134 if not executable:
135135 raise InternalShellError(j, '%r: command not found' % j.args[0])
136136
137137 # Replace uses of /dev/null with temporary files.
144144 args[i] = f.name
145145
146146 procs.append(subprocess.Popen(args, cwd=cwd,
147 executable = executable,
147148 stdin = stdin,
148149 stdout = stdout,
149150 stderr = stderr,
66
77 # CHECK: -- Testing:
88
9 # CHECK: PASS: shtest-format :: argv0.txt
910 # CHECK: FAIL: shtest-format :: external_shell/fail.txt
1011 # CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED ***
1112 # CHECK: Command Output (stdout):
6768 # CHECK: shtest-format :: external_shell/fail_with_bad_encoding.txt
6869 # CHECK: shtest-format :: fail.txt
6970
70 # CHECK: Expected Passes : 3
71 # CHECK: Expected Passes : 4
7172 # CHECK: Expected Failures : 3
7273 # CHECK: Unsupported Tests : 2
7374 # CHECK: Unresolved Tests : 1