[lit] Add --ignore-fail
authorJoel E. Denny <jdenny.ornl@gmail.com>
Wed, 24 Feb 2021 18:05:30 +0000 (13:05 -0500)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Wed, 24 Feb 2021 18:10:27 +0000 (13:10 -0500)
commit2a5aa81739d31959600978c0f11332823010a754
tree1dee2eaec477ed74583aee8854e35a96400e2aa7
parentce2ad938ff1fd4bad6ee91809f970984b1614e35
[lit] Add --ignore-fail

For some build configurations, `check-all` calls lit multiple times to
run multiple lit test suites.  Most recently, I've found this to be
true when configuring openmp as part of `LLVM_ENABLE_RUNTIMES`, but
this is not the first time.

If one test suite fails, none of the remaining test suites run, so you
cannot determine if your patch has broken them.  It can then be
frustrating to try to determine which `check-` targets will run the
remaining tests without getting stuck on the failing tests.

When such cases arise, it is probably best to adjust the cmake
configuration for `check-all` to run all test suites as part of one
lit invocation.  Because that fix will likely not be implemented and
land immediately, this patch introduces `--ignore-fail` to serve as a
workaround for developers trying to see test results until it does
land:

```
$ LIT_OPTS=--ignore-fail ninja check-all
```

One problem with `--ignore-fail` is that it makes it challenging to
detect test failures in a script, perhaps in CI.  This problem should
serve as motivation to actually fix the cmake configuration instead of
continuing to use `--ignore-fail` indefinitely.

Reviewed By: jhenderson, thopre

Differential Revision: https://reviews.llvm.org/D96371
llvm/docs/CommandGuide/lit.rst
llvm/utils/lit/lit/cl_arguments.py
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/Inputs/ignore-fail/fail.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/ignore-fail/lit.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/ignore-fail/unresolved.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/ignore-fail/xfail.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/ignore-fail/xpass.txt [new file with mode: 0644]
llvm/utils/lit/tests/ignore-fail.py [new file with mode: 0644]