[lit] Add an option to print all features used in tests
authorLouis Dionne <ldionne@apple.com>
Fri, 10 Apr 2020 21:41:45 +0000 (17:41 -0400)
committerLouis Dionne <ldionne@apple.com>
Fri, 29 May 2020 11:00:05 +0000 (07:00 -0400)
commitdac21fd29cd2ae2b979a276747ad5ad82fca09bf
tree442629dc19b4cc61acbe614d9d239a3a3d725816
parent01f999ae8871544ab4996fd1368c0dfe4c4a0765
[lit] Add an option to print all features used in tests

Lit test suites can tend to accumulate annotations that are not necessarily
relevant as time goes by, for example XFAILS on old compilers or platforms.
To help spot old annotations that can be cleaned up, it can be useful to
look at all features used inside a test suite.

This commit adds a new Lit option '--show-used-features' that prints all
the features used in XFAIL, REQUIRES and UNSUPPORTED of all tests that
are discovered.

Differential Revision: https://reviews.llvm.org/D78589
llvm/utils/lit/lit/BooleanExpression.py
llvm/utils/lit/lit/Test.py
llvm/utils/lit/lit/TestRunner.py
llvm/utils/lit/lit/cl_arguments.py
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/Inputs/show-used-features/lit.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/show-used-features/mixed.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/show-used-features/requires.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/show-used-features/unsupported.txt [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/show-used-features/xfail.txt [new file with mode: 0644]
llvm/utils/lit/tests/show-used-features.py [new file with mode: 0644]