From e2b540c9e2a52500b17fa1005b26b2dd5a652c09 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 16 Dec 2022 16:43:25 -0500 Subject: tests: Fail early in bfs_diff if the diff fails Otherwise, propagate the exit code from bfs --- tests/tests.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'tests/tests.sh') 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() { -- cgit v1.2.3