diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-12-16 16:43:25 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-12-16 17:26:52 -0500 |
commit | e2b540c9e2a52500b17fa1005b26b2dd5a652c09 (patch) | |
tree | 148a9308e96f9cb86c30afd5743603cc364c9f99 /tests/tests.sh | |
parent | e82a7f51d4b4e90df868e5410a0445b009b54ff2 (diff) | |
download | bfs-e2b540c9e2a52500b17fa1005b26b2dd5a652c09.tar.xz |
tests: Fail early in bfs_diff if the diff fails
Otherwise, propagate the exit code from bfs
Diffstat (limited to 'tests/tests.sh')
-rwxr-xr-x | tests/tests.sh | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/tests.sh b/tests/tests.sh index 4a95fca..9bf9b8b 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -500,8 +500,6 @@ else DIFF="diff" fi -# Return value when bfs fails -EX_BFS=10 # Return value when a difference is detected EX_DIFF=20 # Return value when a test is skipped @@ -529,15 +527,10 @@ function bfs_diff() ( exec 3>&- "${BFS[@]}" "$@" | sort >"$OUT" - local STATUS="${PIPESTATUS[0]}" + local status="${PIPESTATUS[0]}" - diff_output || return $EX_DIFF - - if [ "$STATUS" -eq 0 ]; then - return 0 - else - return $EX_BFS - fi + diff_output || exit $EX_DIFF + return "$status" ) function skip() { |