Reland "[test] Exit with an error if no tests are run."
authorJordan Rupprecht <rupprecht@google.com>
Fri, 28 Aug 2020 21:27:37 +0000 (14:27 -0700)
committerJordan Rupprecht <rupprecht@google.com>
Fri, 28 Aug 2020 21:27:37 +0000 (14:27 -0700)
This reverts commit a06c28df3e8c85ceb665d3d9a1ebc2853dfd87a9 (reland adb5c23f8c0d60eeec41dcbe21d1b26184e1c97d).

The issue with PExpect tests on Windows should be fixed with e5e05ecf65aba836802154279efbc8cbce6fe2ea.

lldb/packages/Python/lldbsuite/test/dotest.py

index 870b85e..c968400 100644 (file)
@@ -1019,6 +1019,10 @@ def run_suite():
             (configuration.suite.countTestCases(),
              configuration.suite.countTestCases() != 1 and "s" or ""))
 
+    if configuration.suite.countTestCases() == 0:
+        logging.error("did not discover any matching tests")
+        exitTestSuite(1)
+
     # Invoke the test runner.
     if configuration.count == 1:
         result = unittest2.TextTestRunner(