mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 11:15:07 -05:00
test: allow tests to be skipped
This commit is contained in:
@@ -2,19 +2,25 @@
|
||||
|
||||
. test.common
|
||||
|
||||
passed=() failed=()
|
||||
passed=() failed=() skipped=()
|
||||
|
||||
[ $# -gt 0 ] && tests=($@) || tests=([0-9]*-*[^_])
|
||||
|
||||
for test in "${tests[@]}"; do
|
||||
echo "$test ($[${#passed[@]} + ${#failed[@]} + 1]/${#tests[@]})"
|
||||
./$test && passed=(${passed[@]} $test) || failed=(${failed[@]} $test)
|
||||
./$test
|
||||
case $? in
|
||||
0) passed=(${passed[@]} $test);;
|
||||
9) skipped=(${skipped[@]} $test);;
|
||||
*) failed=(${failed[@]} $test);;
|
||||
esac
|
||||
echo
|
||||
done
|
||||
|
||||
echo "SUMMARY:"
|
||||
echo " TOTAL $[${#passed[@]} + ${#failed[@]}]"
|
||||
echo " TOTAL $[${#passed[@]} + ${#failed[@]} + ${#skipped[@]}]"
|
||||
echo " PASSED ${#passed[@]}"
|
||||
echo " FAILED ${#failed[@]} (${failed[@]})"
|
||||
echo " SKIPPED ${#skipped[@]} (${skipped[@]})"
|
||||
|
||||
[ ${#failed} -eq 0 ]
|
||||
|
||||
@@ -101,6 +101,11 @@ test_fail() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
test_skip() {
|
||||
echo "SKIP"
|
||||
exit 9
|
||||
}
|
||||
|
||||
test_ok() {
|
||||
pad_line
|
||||
echo -e "\tOK"
|
||||
|
||||
Reference in New Issue
Block a user