llvm.org GIT mirror llvm / c4f3d9f
Relax shtest-run-at-line.py The test was failing on Windows machines which had bash.exe on PATH (but not in the so called lit tools dir, containing cmp.exe, grep.exe etc.). The problem was that the outer lit invocation would load LLVMConfig from utils/lit/lit/llvm/config.py, which looks up the tools path with getToolsPath(). That has a surprising side effect of also setting bashPath, in our case setting it to empty. The outer lit invocation would thus configure the pdbg0 and pdbg1 substitutions based on not running with bash. But the inner lit invocation would not load LLVMConfig, so bash would be found on PATH, that would be used as external shell, and so the output wouldn't match pdbg0 and pdbg1. It seems weird to me that getBashPath() will return different results depending on whether getToolsPath() has been called before, but I also don't know how to fix it properly. This commit just relaxes the test case, because there doesn't seem to be much point in testing for the exact syntax of the run file as long as it works. (See https://crbug.com/850023) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334100 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 1 year, 4 months ago
2 changed file(s) with 7 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
7070 if directory:
7171 path = os.path.pathsep.join((directory, path))
7272 config.environment['PATH'] = path
73
74 # These substitutions are needed only in tests where the external shell is used
75 # and could be either bash or windows cmd.exe. Substitutions are expected to
76 # be expanded in double quotes.
77 isWin32CMDEXE = lit_config.isWindows and not lit_config.getBashPath()
78 if isWin32CMDEXE:
79 config.substitutions.append(('%{pdbg0}', "echo '"))
80 config.substitutions.append(('%{pdbg1}', "' > nul &&"))
81 else:
82 config.substitutions.append(('%{pdbg0}', ": '"))
83 config.substitutions.append(('%{pdbg1}', "';"))
11 # (-v is actually sufficient in the case of the internal shell.)
22 #
33 # RUN: not %{lit} -j 1 -vv %{inputs}/shtest-run-at-line > %t.out
4 # RUN: FileCheck --input-file %t.out -Dpdbg0="%{pdbg0}" -Dpdbg1="%{pdbg1}" %s
4 # RUN: FileCheck --input-file %t.out %s
55 #
66 # END.
77
1515 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/basic.txt
1616
1717 # CHECK: Script:
18 # CHECK: [[pdbg0]]RUN: at line 4[[pdbg1]] true
19 # CHECK-NEXT: [[pdbg0]]RUN: at line 5[[pdbg1]] false
20 # CHECK-NEXT: [[pdbg0]]RUN: at line 6[[pdbg1]] true
18 # CHECK: RUN: at line 4{{.*}} true
19 # CHECK-NEXT: RUN: at line 5{{.*}} false
20 # CHECK-NEXT: RUN: at line 6{{.*}} true
2121
2222 # CHECK: RUN: at line 4
2323 # CHECK: RUN: at line 5
2626 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/line-continuation.txt
2727
2828 # CHECK: Script:
29 # CHECK: [[pdbg0]]RUN: at line 4[[pdbg1]] echo 'foo bar' | FileCheck
30 # CHECK-NEXT: [[pdbg0]]RUN: at line 6[[pdbg1]] echo 'foo baz' | FileCheck
31 # CHECK-NEXT: [[pdbg0]]RUN: at line 9[[pdbg1]] echo 'foo bar' | FileCheck
29 # CHECK: RUN: at line 4{{.*}} echo 'foo bar' | FileCheck
30 # CHECK-NEXT: RUN: at line 6{{.*}} echo 'foo baz' | FileCheck
31 # CHECK-NEXT: RUN: at line 9{{.*}} echo 'foo bar' | FileCheck
3232
3333 # CHECK: RUN: at line 4
3434 # CHECK: RUN: at line 6