[LIT] error if directly named test won't be run indirectly
authorBen Dunbobbin <Ben.Dunbobbin@sony.com>
Wed, 21 Oct 2020 12:09:15 +0000 (13:09 +0100)
committerBen Dunbobbin <Ben.Dunbobbin@sony.com>
Wed, 21 Oct 2020 12:21:29 +0000 (13:21 +0100)
commit81c0d36a1836c9be7c34a6d8198310ad7ea9bb53
tree054e5592812124d87b76c350ee3cc0ae053c1511
parent96685faf6dd9b044394af6f7a9d8b10fadb327b5
[LIT] error if directly named test won't be run indirectly

Currently, a LIT test named directly (on the command line) will
be run even if the name of the test file does not meet the rules
to be considered a test in the LIT test configuration files for
its test suite. For example, if the test does not have a
recognised file extension.

This makes it relatively easy to write a LIT test that won't
actually be run. I did in: https://reviews.llvm.org/D82567

This patch adds an error to avoid users doing that. There is a
small performance overhead for this check. A command line option
has been added so that users can opt into the old behaviour.

Differential Revision: https://reviews.llvm.org/D83069
llvm/utils/lit/lit/LitTestCase.py
llvm/utils/lit/lit/cl_arguments.py
llvm/utils/lit/lit/discovery.py
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/Inputs/discovery/test.not-txt [new file with mode: 0644]
llvm/utils/lit/tests/discovery.py
llvm/utils/lit/tests/unit/TestRunner.py