From e82a7f51d4b4e90df868e5410a0445b009b54ff2 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 16 Dec 2022 15:51:59 -0500 Subject: tests: Print the skip reason for --verbose=skipped --- tests/tests.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/tests.sh') diff --git a/tests/tests.sh b/tests/tests.sh index 7ccd9b5..4a95fca 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -191,7 +191,6 @@ for arg; do VERBOSE_SKIPPED=yes ;; --verbose=tests) - VERBOSE_SKIPPED=yes VERBOSE_TESTS=yes ;; --verbose) @@ -542,6 +541,15 @@ function bfs_diff() ( ) function skip() { + if [ "$VERBOSE_SKIPPED" ]; then + caller | { + read -r line file + printf "${BOL}${CYN}%s skipped!${RST} (%s)\n" "$TEST" "$(awk "NR == $line" "$file")" + } + elif [ "$VERBOSE_TESTS" ]; then + printf "${BOL}${CYN}%s skipped!${RST}\n" "$TEST" + fi + exit $EX_SKIP } @@ -673,9 +681,6 @@ for TEST in "${TEST_CASES[@]}"; do ((++passed)) elif ((status == EX_SKIP)); then ((++skipped)) - if [ "$VERBOSE_SKIPPED" ]; then - printf "${BOL}${CYN}%s skipped!${RST}\n" "$TEST" - fi else ((++failed)) [ "$VERBOSE_ERRORS" ] || cat "$TMP/stderr" >&2 -- cgit v1.2.3