[llvm] r334100 - Relax shtest-run-at-line.py

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 07:53:04 PDT 2018


Author: hans
Date: Wed Jun  6 07:53:03 2018
New Revision: 334100

URL: http://llvm.org/viewvc/llvm-project?rev=334100&view=rev
Log:
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)

Modified:
    llvm/trunk/utils/lit/tests/lit.cfg
    llvm/trunk/utils/lit/tests/shtest-run-at-line.py

Modified: llvm/trunk/utils/lit/tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/lit.cfg?rev=334100&r1=334099&r2=334100&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/lit.cfg (original)
+++ llvm/trunk/utils/lit/tests/lit.cfg Wed Jun  6 07:53:03 2018
@@ -71,14 +71,3 @@ for attribute in ('llvm_tools_dir', 'lit
     if directory:
         path = os.path.pathsep.join((directory, path))
 config.environment['PATH'] = path
-
-# These substitutions are needed only in tests where the external shell is used
-# and could be either bash or windows cmd.exe.  Substitutions are expected to
-# be expanded in double quotes.
-isWin32CMDEXE = lit_config.isWindows and not lit_config.getBashPath()
-if isWin32CMDEXE:
-    config.substitutions.append(('%{pdbg0}', "echo '"))
-    config.substitutions.append(('%{pdbg1}', "' > nul &&"))
-else:
-    config.substitutions.append(('%{pdbg0}', ": '"))
-    config.substitutions.append(('%{pdbg1}', "';"))

Modified: llvm/trunk/utils/lit/tests/shtest-run-at-line.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/shtest-run-at-line.py?rev=334100&r1=334099&r2=334100&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/shtest-run-at-line.py (original)
+++ llvm/trunk/utils/lit/tests/shtest-run-at-line.py Wed Jun  6 07:53:03 2018
@@ -2,7 +2,7 @@
 # (-v is actually sufficient in the case of the internal shell.)
 #
 # RUN: not %{lit} -j 1 -vv %{inputs}/shtest-run-at-line > %t.out
-# RUN: FileCheck --input-file %t.out -Dpdbg0="%{pdbg0}" -Dpdbg1="%{pdbg1}" %s
+# RUN: FileCheck --input-file %t.out %s
 #
 # END.
 
@@ -16,9 +16,9 @@
 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/basic.txt
 
 # CHECK:      Script:
-# CHECK:      [[pdbg0]]RUN: at line 4[[pdbg1]]  true
-# CHECK-NEXT: [[pdbg0]]RUN: at line 5[[pdbg1]]  false
-# CHECK-NEXT: [[pdbg0]]RUN: at line 6[[pdbg1]]  true
+# CHECK:      RUN: at line 4{{.*}}  true
+# CHECK-NEXT: RUN: at line 5{{.*}}  false
+# CHECK-NEXT: RUN: at line 6{{.*}}  true
 
 # CHECK:     RUN: at line 4
 # CHECK:     RUN: at line 5
@@ -27,9 +27,9 @@
 # CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/line-continuation.txt
 
 # CHECK:      Script:
-# CHECK:      [[pdbg0]]RUN: at line 4[[pdbg1]]  echo 'foo bar'  | FileCheck
-# CHECK-NEXT: [[pdbg0]]RUN: at line 6[[pdbg1]]  echo  'foo baz'  | FileCheck
-# CHECK-NEXT: [[pdbg0]]RUN: at line 9[[pdbg1]]  echo 'foo bar'  | FileCheck
+# CHECK:      RUN: at line 4{{.*}}  echo 'foo bar'  | FileCheck
+# CHECK-NEXT: RUN: at line 6{{.*}}  echo 'foo baz'  | FileCheck
+# CHECK-NEXT: RUN: at line 9{{.*}}  echo 'foo bar'  | FileCheck
 
 # CHECK:     RUN: at line 4
 # CHECK:     RUN: at line 6




More information about the llvm-commits mailing list