From: Miroslav Lichvar Date: Thu, 14 Aug 2014 15:58:59 +0000 (+0200) Subject: test: allow tests to be skipped X-Git-Tag: 1.31-pre1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8af2993215b4f14432f8dba80fa976c3d9b767c;p=thirdparty%2Fchrony.git test: allow tests to be skipped --- diff --git a/test/simulation/run b/test/simulation/run index 75fc4e4b..cbc7b8d3 100755 --- a/test/simulation/run +++ b/test/simulation/run @@ -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 ] diff --git a/test/simulation/test.common b/test/simulation/test.common index 11786119..8aee4546 100644 --- a/test/simulation/test.common +++ b/test/simulation/test.common @@ -101,6 +101,11 @@ test_fail() { exit 1 } +test_skip() { + echo "SKIP" + exit 9 +} + test_ok() { pad_line echo -e "\tOK"