summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/tests
diff options
context:
space:
mode:
authorJulian Lettner <julian.lettner@apple.com>2019-11-01 18:52:50 -0700
committerJulian Lettner <julian.lettner@apple.com>2019-11-04 10:16:24 -0800
commitd8f2bff75126c6dde694ad245f9807fa12ad5630 (patch)
tree2c64e10ddee5a1f9412acbfb33326f47f57d38cd /llvm/utils/lit/tests
parentbe6ac471f613427f3b5b3a306fe033e526d59f76 (diff)
downloadbcm5719-llvm-d8f2bff75126c6dde694ad245f9807fa12ad5630.tar.gz
bcm5719-llvm-d8f2bff75126c6dde694ad245f9807fa12ad5630.zip
[lit] Better/earlier errors when no tests are executed
Fail early, when we discover no tests at all, or filter out all of them.
Diffstat (limited to 'llvm/utils/lit/tests')
-rw-r--r--llvm/utils/lit/tests/selecting.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/utils/lit/tests/selecting.py b/llvm/utils/lit/tests/selecting.py
index 0921cdd31ac..cfbb9d19b6d 100644
--- a/llvm/utils/lit/tests/selecting.py
+++ b/llvm/utils/lit/tests/selecting.py
@@ -1,6 +1,18 @@
# RUN: %{lit} %{inputs}/discovery | FileCheck --check-prefix=CHECK-BASIC %s
# CHECK-BASIC: Testing: 5 tests
+
+# Check that we exit with an error if we do not discover any tests.
+#
+# RUN: not %{lit} %{inputs}/nonexistent 2>&1 | FileCheck --check-prefix=CHECK-BAD-PATH %s
+# CHECK-BAD-PATH: Did not disover any tests for provided path(s).
+
+# Check that we exit with an error if we filter out all tests.
+#
+# RUN: not %{lit} --filter 'nonexistent' %{inputs}/discovery 2>&1 | FileCheck --check-prefix=CHECK-BAD-FILTER %s
+# CHECK-BAD-FILTER: Filter did not match any tests (of 5 discovered).
+
+
# Check that regex-filtering works, is case-insensitive, and can be configured via env var.
#
# RUN: %{lit} --filter 'o[a-z]e' %{inputs}/discovery | FileCheck --check-prefix=CHECK-FILTER %s
@@ -8,6 +20,7 @@
# RUN: env LIT_FILTER='o[a-z]e' %{lit} %{inputs}/discovery | FileCheck --check-prefix=CHECK-FILTER %s
# CHECK-FILTER: Testing: 2 of 5 tests
+
# Check that maximum counts work
#
# RUN: %{lit} --max-tests 3 %{inputs}/discovery | FileCheck --check-prefix=CHECK-MAX %s
@@ -68,15 +81,13 @@
#
# RUN: %{lit} --num-shards 100 --run-shard 6 %{inputs}/discovery >%t.out 2>%t.err
# RUN: FileCheck --check-prefix=CHECK-SHARD-BIG-ERR2 < %t.err %s
-# RUN: FileCheck --check-prefix=CHECK-SHARD-BIG-OUT2 < %t.out %s
# CHECK-SHARD-BIG-ERR2: note: Selecting shard 6/100 = size 0/5 = tests #(100*k)+6 = []
-# CHECK-SHARD-BIG-OUT2: Testing: 0 of 5 tests
+# CHECK-SHARD-BIG-ERR2: Shard does not contain any tests. Consider decreasing the shard count.
#
# RUN: %{lit} --num-shards 100 --run-shard 50 %{inputs}/discovery >%t.out 2>%t.err
# RUN: FileCheck --check-prefix=CHECK-SHARD-BIG-ERR3 < %t.err %s
-# RUN: FileCheck --check-prefix=CHECK-SHARD-BIG-OUT3 < %t.out %s
# CHECK-SHARD-BIG-ERR3: note: Selecting shard 50/100 = size 0/5 = tests #(100*k)+50 = []
-# CHECK-SHARD-BIG-OUT3: Testing: 0 of 5 tests
+# CHECK-SHARD-BIG-ERR3: Shard does not contain any tests. Consider decreasing the shard count.
# Check that range constraints are enforced
OpenPOWER on IntegriCloud