Skip to content

Commit b4f3078

Browse files
committed
check: report number of failed test cases and skipped test cases
As a part of the Blktests CI preparation, improve the test result reporting. Record failed test cases in the file named "failures" in the results output directory. Print the count and the list of failed test cases at the end of test runs. Do the same for skipped test cases using the file named "skips". The output will be like this: $ sudo ./check meta meta/001 (do nothing) [passed] runtime 0.000s ... 0.000s [...] meta/019 (x=1 y=1 z=1) (combine three set_conditions() hooks) [passed] runtime 0.000s ... 0.000s 4 failures: meta/003 meta/005 meta/006 meta/009 2 skips: meta/007 meta/014 Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 255189f commit b4f3078

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

check

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,14 @@ _call_test() {
531531
}" "${seqres}.kmemleak"
532532
;;
533533
esac
534+
535+
echo "$TEST_NAME" >> "$FAILURES"
534536
return 1
535-
else
536-
return 0
537+
elif [[ ${TEST_RUN["status"]} = 'not run' ]]; then
538+
echo "$TEST_NAME" >> "$SKIPS"
537539
fi
540+
541+
return 0
538542
}
539543

540544
_test_dev_is_zoned() {
@@ -1263,5 +1267,16 @@ fi
12631267
12641268
mkdir -p "$OUTPUT"
12651269
OUTPUT="$(realpath "$OUTPUT")"
1270+
FAILURES="$OUTPUT/failures"
1271+
SKIPS="$OUTPUT/skips"
1272+
rm -f "$FAILURES" "$SKIPS"
12661273
12671274
_check "$@"
1275+
1276+
declare -a failures skips
1277+
declare l
1278+
[[ -f $FAILURES ]] && while read -r l; do failures+=("$l"); done < "$FAILURES"
1279+
((${#failures[@]})) && echo "${#failures[@]} failures: ${failures[*]}"
1280+
1281+
[[ -f $SKIPS ]] && while read -r l; do skips+=("$l"); done < "$SKIPS"
1282+
((${#skips[@]})) && echo "${#skips[@]} skips: ${skips[*]}"

0 commit comments

Comments
 (0)