[llvm] 012d844 - [lit] Fix c981c533055e's remaining test fails under windows

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 11:48:31 PDT 2023


Author: Joel E. Denny
Date: 2023-08-29T14:38:16-04:00
New Revision: 012d844fb856a89368aca95ca994726554b90f22

URL: https://github.com/llvm/llvm-project/commit/012d844fb856a89368aca95ca994726554b90f22
DIFF: https://github.com/llvm/llvm-project/commit/012d844fb856a89368aca95ca994726554b90f22.diff

LOG: [lit] Fix c981c533055e's remaining test fails under windows

For `llvm/utils/lit/tests/shtest-output-printing.py`, the executable
in `%{python}` wasn't properly shell-quoted for windows.  This caused
the 127 exit code mentioned in f254bbf23374.  Fix quoting and expect
exit code 1 again.

Fix shell-quoting issue in a few more file names in
`llvm/utils/lit/tests/shtest-shell.py`, missed in f254bbf23374.

Test failures seen in
<https://lab.llvm.org/buildbot/#/builders/216/builds/26436>.

Added: 
    

Modified: 
    llvm/utils/lit/tests/Inputs/shtest-output-printing/lit.cfg
    llvm/utils/lit/tests/shtest-output-printing.py
    llvm/utils/lit/tests/shtest-shell.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/tests/Inputs/shtest-output-printing/lit.cfg b/llvm/utils/lit/tests/Inputs/shtest-output-printing/lit.cfg
index c53fd157b6ae2d..141fc3a596e77a 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-output-printing/lit.cfg
+++ b/llvm/utils/lit/tests/Inputs/shtest-output-printing/lit.cfg
@@ -2,5 +2,5 @@ import lit.formats
 
 config.name = "shtest-output-printing"
 config.suffixes = [".txt"]
-config.substitutions.append(("%{python}", sys.executable))
+config.substitutions.append(("%{python}", f'"{sys.executable}"'))
 config.test_format = lit.formats.ShTest(execute_external=False)

diff  --git a/llvm/utils/lit/tests/shtest-output-printing.py b/llvm/utils/lit/tests/shtest-output-printing.py
index 427ce8f235dd05..3e49197520a977 100644
--- a/llvm/utils/lit/tests/shtest-output-printing.py
+++ b/llvm/utils/lit/tests/shtest-output-printing.py
@@ -8,7 +8,7 @@
 #       CHECK: -- Testing: {{.*}}
 #       CHECK: FAIL: shtest-output-printing :: basic.txt {{.*}}
 #  CHECK-NEXT: ***{{\**}} TEST 'shtest-output-printing :: basic.txt' FAILED ***{{\**}}
-#  CHECK-NEXT: Exit Code: {{[1-9][0-9]*}}
+#  CHECK-NEXT: Exit Code: 1
 # CHECK-EMPTY:
 #  CHECK-NEXT: Command Output (stdout):
 #  CHECK-NEXT: --

diff  --git a/llvm/utils/lit/tests/shtest-shell.py b/llvm/utils/lit/tests/shtest-shell.py
index 97d946643b39fe..a957fdda7b3c49 100644
--- a/llvm/utils/lit/tests/shtest-shell.py
+++ b/llvm/utils/lit/tests/shtest-shell.py
@@ -475,7 +475,7 @@
 # CHECK-NEXT: # executed command: true
 
 #      CHECK: 
diff  -U0 {{.*}}.foo {{.*}}.bar && false || true
-# CHECK-NEXT: 
diff  -U0 {{.*}}.foo {{.*}}.bar
+# CHECK-NEXT: # executed command: 
diff  -U0 {{.+}}.foo{{.*}} {{.+}}.bar{{.*}}
 # CHECK-NEXT: # .---command stdout{{-*}}
 #      CHECK: # | @@ {{.*}} @@
 # CHECK-NEXT: # | -6 foo


        


More information about the llvm-commits mailing list