Skip to content

Commit 10fbdbd

Browse files
committed
printf
1 parent 0fb301f commit 10fbdbd

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

tests/run_standalone_tests.sh

+20-4
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ fi
8080
# clear all the collected reports
8181
rm -f parallel_test_output-*.txt # in case it exists, remove it
8282

83-
8483
status=0 # reset the script status
8584
report="" # final report
8685
pids=() # array of PID for running tests
8786
test_ids=() # array of indexes of running tests
87+
failed_tests=() # array of failed tests
8888
printf "Running $test_count tests in batches of $test_batch_size\n"
8989
for i in "${!tests[@]}"; do
9090
test=${tests[$i]}
@@ -112,8 +112,8 @@ for i in "${!tests[@]}"; do
112112
# add row to the final report
113113
report+="Ran\t$test\t>> exit:$test_status\n"
114114
if [[ $test_status != 0 ]]; then
115-
# show the output of the failed test
116-
cat "parallel_test_output-$i.txt"
115+
# add the test to the failed tests array
116+
failed_tests+=($i)
117117
# Process exited with a non-zero exit status
118118
status=$test_status
119119
fi
@@ -123,11 +123,27 @@ for i in "${!tests[@]}"; do
123123
fi
124124
done
125125

126-
# echo test report
126+
# print test report
127127
printf '=%.s' {1..80}
128128
printf "\n$report"
129129
printf '=%.s' {1..80}
130130
printf '\n'
131131

132+
# print failed tests
133+
if [[ ${#failed_tests[@]} -gt 0 ]]; then
134+
printf "Failed tests:\n"
135+
for i in "${failed_tests[@]}"; do
136+
printf "\n\n"
137+
pritf "=" * 80
138+
printf "${tests[$i]}\n"
139+
pritf "-" * 80
140+
# show the output of the failed test
141+
cat "parallel_test_output-$i.txt"
142+
pritf "=" * 80
143+
done
144+
else
145+
printf "All tests passed!\n"
146+
fi
147+
132148
# exit with the worse test result
133149
exit $status

0 commit comments

Comments
 (0)