From 8fe44bd740cf6cfb1545904e903bc2368e49d1d7 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Mon, 9 Dec 2024 07:33:05 +0000 Subject: [PATCH] Implement failure count --- test/envsub/run-tests.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/envsub/run-tests.sh b/test/envsub/run-tests.sh index 79c7aaf1..0466423a 100755 --- a/test/envsub/run-tests.sh +++ b/test/envsub/run-tests.sh @@ -3,7 +3,7 @@ log() { echo >&2 "[test/envsub] $*"; } -failed=0 +failCount=0 log "should correctly substitute provided values" if diff <( \ @@ -15,7 +15,7 @@ if diff <( \ ) good-example.expected; then log " OK" else - failed=1 + ((++failCount)) log " FAILED" fi @@ -23,13 +23,13 @@ log "should fail when asked to substitute undefined value" if ! ../../files/shared/envsub.sh <<<'${NOT_DEFINED}'; then log " OK" else - failed=1 + ((++failCount)) log " FAILED" fi -if [[ "$failed" = 0 ]]; then +if [[ "$failCount" = 0 ]]; then log "All tests passed OK." else - log "TEST(S) FAILED" + log "$failCount TEST(S) FAILED" exit 1 fi