summaryrefslogtreecommitdiffstats
path: root/tests/shell/run-tests.sh
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-09-13 19:11:01 +0200
committerFlorian Westphal <fw@strlen.de>2023-09-15 16:14:02 +0200
commita65de4e86dcba7dd731a16aa183e1ef1f613b838 (patch)
tree8ff52162406771bb3ba6276757effe34cf899837 /tests/shell/run-tests.sh
parentf7421e4cb07ebb16c2d21df6e98e0eb2b7462ea4 (diff)
tests/shell: exit 77 from "run-tests.sh" if all tests were skipped
If there are multiple tests and some of them pass and some are skipped, the overall result should be success (zero). Because likely the user just selected a bunch of tests (or all of them). So skipping some tests does not mean that the entire run is not a success. However, if all tests are skipped, then mark the overall result as skipped too. The more common case is if you only run one single test, then we want to know, that the test didn't run. Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/run-tests.sh')
-rwxr-xr-xtests/shell/run-tests.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 8f55c81f..65bd5c1d 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -821,4 +821,10 @@ if [ "$failed" -gt 0 -o "$NFT_TEST_KEEP_LOGS" = y ] ; then
NFT_TEST_TMPDIR=
fi
-[ "$failed" -eq 0 ]
+if [ "$failed" -gt 0 ] ; then
+ exit 1
+elif [ "$ok" -eq 0 -a "$skipped" -gt 0 ] ; then
+ exit 77
+else
+ exit 0
+fi