[PATCH] D65156: [lit] Protect full test suite from FILECHECK_OPTS

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 11:32:17 PDT 2019


jdenny added a comment.

In D65156#1608810 <https://reviews.llvm.org/D65156#1608810>, @jdenny wrote:

> I'm thinking a more general fix is to implement `not` in lit's internal shell.  `not` in front of any lit's internal shell commands is a problem.


Below is a quick hack to see if this approach solves the recent problems.  Can @stella.stamenova, @probinson, and @mgorny (who all seem to have experienced slightly different variations on this problem) please check that "ninja check-lit" succeeds on their bots?  My expectation is that D65335 <https://reviews.llvm.org/D65335> is not necessary with this change.  This is not a complete implementation of `not`, so I'm not sure other test suites will pass.  I'll work on that afterward.

  diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
  index ac627d51c1c1..042734b1f8e2 100644
  --- a/llvm/utils/lit/lit/TestRunner.py
  +++ b/llvm/utils/lit/lit/TestRunner.py
  @@ -859,6 +859,11 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
           results.append(ShellCommandResult(cmd.commands[0], '', '', 0, False))
           return 0;
   
  +    if cmd.commands[0].args[0] == 'not':
  +        cmd.commands[0].args.pop(0)
  +        res = _executeShCmd(cmd, shenv, results, timeoutHelper)
  +        return res == 0
  +
       procs = []
       default_stdin = subprocess.PIPE
       stderrTempFiles = []
  diff --git a/llvm/utils/lit/tests/shtest-output-printing.py b/llvm/utils/lit/tests/shtest-output-printing.py
  index 80304258fd95..57f830fbe920 100644
  --- a/llvm/utils/lit/tests/shtest-output-printing.py
  +++ b/llvm/utils/lit/tests/shtest-output-printing.py
  @@ -24,7 +24,7 @@
   # CHECK-NEXT: hi
   #
   # CHECK:      $ ":" "RUN: at line 3"
  -# CHECK-NEXT: $ "not" "not" "wc" "missing-file"
  +# CHECK-NEXT: $ "wc" "missing-file"
   # CHECK-NEXT: # redirected output from '{{.*(/|\\\\)}}basic.txt.tmp.out':
   # CHECK-NEXT: {{cannot open missing-file|missing-file.* No such file or directory}}
   # CHECK:      note: command had no output on stdout or stderr


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65156/new/

https://reviews.llvm.org/D65156





More information about the llvm-commits mailing list