[test] Exit with an error if no tests are run.
authorJordan Rupprecht <rupprecht@google.com>
Mon, 3 Aug 2020 23:30:41 +0000 (16:30 -0700)
committerJordan Rupprecht <rupprecht@google.com>
Mon, 3 Aug 2020 23:32:12 +0000 (16:32 -0700)
commitadb5c23f8c0d60eeec41dcbe21d1b26184e1c97d
tree2569535d9a6bad3b3ebb5026de0bbd24e14cc271
parent3b44b6c900d1b71e6a6590e376d11dc303ac5159
[test] Exit with an error if no tests are run.

If the test suite is misconfigured when it's run (a bad regexp, wrong test directory, etc.), the test suite may not discover any tests. When this happens, the test runner exits happily because no tests failed:

```
Ran 0 tests in 0.000s
RESULT: PASSED (0 passes, 0 failures, 0 errors, 0 skipped, 0 expected failures, 0 unexpected successes)
```

Change this to return an error so the misconfiguration can be more easily detected. Verified that `lldb-dotest -p TestDoesNotExist.py` successfully fails.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D85169
lldb/packages/Python/lldbsuite/test/dotest.py