From: Joel Rosdahl Date: Fri, 24 Jul 2020 13:57:08 +0000 (+0200) Subject: Remove test directory for skipped test suite X-Git-Tag: v4.0~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a350e0a9f4fa4e82078c2a0bbc812981cf60855;p=thirdparty%2Fccache.git Remove test directory for skipped test suite --- diff --git a/test/run b/test/run index 469a83174..eb17a04fe 100755 --- a/test/run +++ b/test/run @@ -21,6 +21,7 @@ # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +skip_code=125 # only use ansi color codes if output is to a terminal if [[ -t 1 ]]; then @@ -287,15 +288,17 @@ run_suite() { if [ -n "$skip_reason" ]; then echo "Skipped test suite $suite_name [$skip_reason]" if [ -n "$EXIT_IF_SKIPPED" ]; then - exit 125 + return $skip_code fi - return + return 0 fi fi printf "Running test suite %s" "$(bold $suite_name)" SUITE_$suite_name echo + + return 0 } TEST() { @@ -532,11 +535,22 @@ if [ -z "$suites" ]; then suites="$all_suites" fi +skipped=false for suite in $suites; do run_suite $suite + if [ $? -eq $skip_code ]; then + skipped=true + break + fi done cd / rm -rf $ABS_TESTDIR -green PASSED -exit 0 + +if $skipped; then + exit $skip_code +else + green PASSED + exit 0 +fi +