Skip to content

Commit

Permalink
Implement failure count
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Dec 9, 2024
1 parent 725a30b commit 8fe44bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/envsub/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
log() { echo >&2 "[test/envsub] $*"; }


failed=0
failCount=0

log "should correctly substitute provided values"
if diff <( \
Expand All @@ -15,21 +15,21 @@ if diff <( \
) good-example.expected; then
log " OK"
else
failed=1
((++failCount))
log " FAILED"
fi

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

0 comments on commit 8fe44bd

Please sign in to comment.