]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: implement ts_skip_subtest
authorKarel Zak <kzak@redhat.com>
Mon, 11 Jul 2016 09:01:14 +0000 (11:01 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Jul 2016 09:01:14 +0000 (11:01 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/functions.sh
tests/ts/schedutils/chrt

index db5f536c652c8d15ef74cd7f8fe7365396b51b69..b9a8523652bdae2b8ad2d973b31a7d2d3d4947d8 100644 (file)
@@ -91,12 +91,12 @@ function ts_check_losetup {
        ts_skip "no loop-device support"
 }
 
-function ts_skip_subtest {
+function ts_report_skip {
        ts_report " SKIPPED ($1)"
 }
 
 function ts_skip {
-       ts_skip_subtest "$1"
+       ts_report_skip "$1"
 
        ts_cleanup_on_exit
        exit 0
@@ -130,7 +130,7 @@ function ts_failed {
        exit $?
 }
 
-function ts_ok_subtest {
+function ts_report_ok {
        if [ x"$1" == x"" ]; then
                ts_report " OK"
        else
@@ -139,7 +139,7 @@ function ts_ok_subtest {
 }
 
 function ts_ok {
-       ts_ok_subtest "$1"
+       ts_report_ok "$1"
        exit 0
 }
 
@@ -413,7 +413,7 @@ function ts_finalize_subtest {
                ts_failed_subtest "$1"
                res=1
        else
-               ts_ok_subtest "$(tt_gen_mem_report "$1")"
+               ts_report_ok "$(tt_gen_mem_report "$1")"
        fi
 
        [ $res -ne 0 ] && TS_NSUBFAILED=$(( $TS_NSUBFAILED + 1 ))
@@ -424,6 +424,13 @@ function ts_finalize_subtest {
        return $res
 }
 
+function ts_skip_subtest {
+       ts_report_skip "$1"
+       # reset environment back to parental test
+       ts_init_core_env
+
+}
+
 function ts_finalize {
        ts_cleanup_on_exit
 
index 31bc7fdaa20d40aa98c357ab6f5abc81855b1230..38c87f9f0524b0dfc45700cf25dd2c3e4c93085b 100755 (executable)
@@ -45,8 +45,8 @@ if [ $? == 0 ]; then
        do_chrt --fifo 1
        do_chrt --fifo 99
        cleanup_output
+       ts_finalize_subtest
 fi
-ts_finalize_subtest
 
 
 ts_init_subtest "batch"
@@ -54,8 +54,8 @@ skip_policy SCHED_BATCH
 if [ $? == 0 ]; then
        do_chrt --batch 0
        cleanup_output
+       ts_finalize_subtest
 fi
-ts_finalize_subtest
 
 
 ts_init_subtest "other"
@@ -63,8 +63,8 @@ skip_policy SCHED_OTHER
 if [ $? == 0 ]; then
        do_chrt --other 0
        cleanup_output
+       ts_finalize_subtest
 fi
-ts_finalize_subtest
 
 
 ts_init_subtest "rr"
@@ -73,8 +73,8 @@ if [ $? == 0 ]; then
        do_chrt --rr 1
        do_chrt --rr 99
        cleanup_output
+       ts_finalize_subtest
 fi
-ts_finalize_subtest
 
 
 ts_init_subtest "idle"
@@ -82,8 +82,8 @@ skip_policy SCHED_IDLE
 if [ $? == 0 ]; then
        do_chrt --idle 0
        cleanup_output
+       ts_finalize_subtest
 fi
-ts_finalize_subtest
 
 
 ts_init_subtest "deadline"
@@ -93,7 +93,7 @@ if [ $? == 0 ]; then
        do_chrt --deadline --sched-period 13000 --sched-deadline 12000 0
        do_chrt --deadline --sched-period 13000 --sched-deadline 12000 --sched-runtime 10000 0
        cleanup_output
+       ts_finalize_subtest
 fi
-ts_finalize_subtest
 
 ts_finalize