[PATCH] D98859: [lit] Handle plain negations directly in the internal shell

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 18 14:42:49 PDT 2021


mstorsjo added inline comments.


================
Comment at: llvm/utils/lit/lit/TestRunner.py:787
                                           close_fds = kUseCloseFDs))
+            negate_procs.append((not_count % 2) != 0)
             # Let the helper know about this process
----------------
mstorsjo wrote:
> hubert.reinterpretcast wrote:
> > Hello, this logic is not actually sound: There are tests that are sensitive to the specific return code and not just whether the result is zero or not.
> > 
> > From http://lab.llvm.org:8014/#/builders/126/builds/273/steps/5/logs/stdio:
> > ```
> > /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/shtest-output-printing.py:15:15: error: CHECK-NEXT: expected string not found in input
> > # CHECK-NEXT: Exit Code: 1
> >               ^
> > /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Output/shtest-output-printing.py.tmp.out:9:3: note: scanning from here
> > --
> >   ^
> > /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Output/shtest-output-printing.py.tmp.out:10:1: note: possible intended match here
> > Exit Code: 2
> > ^
> > 
> > Input file: /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Output/shtest-output-printing.py.tmp.out
> > Check file: /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/shtest-output-printing.py
> > 
> > -dump-input=help explains the following input dump.
> > 
> > Input was:
> > <<<<<<
> >            1: -- Testing: 1 tests, 1 workers --_
> >            2: FAIL: shtest-output-printing :: basic.txt (1 of 1)_
> >            3: ******************** TEST 'shtest-output-printing :: basic.txt' FAILED ********************_
> >            4: Script:_
> >            5: --_
> >            6: : 'RUN: at line 1'; true_
> >            7: : 'RUN: at line 2'; echo hi_
> >            8: : 'RUN: at line 3'; not not wc missing-file &> /scratch/powerllvm/powerllvm_env/aix-ppc64-ppc64le/clang-ppc64-aix-ppc64le/stage1/utils/lit/tests/Inputs/shtest-output-printing/Output/basic.txt.tmp.out_
> >            9: --_
> > next:15'0       X error: no match found
> >           10: Exit Code: 2_
> > next:15'0     ~~~~~~~~~~~~~
> > next:15'1     ?             possible intended match
> > ```
> > 
> > @mstorsjo, please revert if a fix (with an appropriate test) is not forthcoming.
> Thanks for pointing this out, and sorry for the breakage. I'll push a fix including a test for it momentarily.
@jdenny I pushed a fix for this in rGd0b03ec401e8465b88893a4c56aeb0c787a54ad9, I hope you don't mind - let me know if you'd want changes to it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98859



More information about the llvm-commits mailing list