summaryrefslogtreecommitdiffstats
path: root/tests/ts/cal
diff options
context:
space:
mode:
authorKarel Zak2018-01-22 15:01:05 +0100
committerKarel Zak2018-01-22 15:01:05 +0100
commit5c8324fb88080238786c8ae31bc5640d9b7e9bd6 (patch)
tree41bdb70730d801ede0731eb09eebd8548cde958b /tests/ts/cal
parenttests: simplify cal(1) sep1752w test (diff)
downloadkernel-qcow2-util-linux-5c8324fb88080238786c8ae31bc5640d9b7e9bd6.tar.gz
kernel-qcow2-util-linux-5c8324fb88080238786c8ae31bc5640d9b7e9bd6.tar.xz
kernel-qcow2-util-linux-5c8324fb88080238786c8ae31bc5640d9b7e9bd6.zip
tests: use subtests for sep1752w test
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/cal')
-rwxr-xr-xtests/ts/cal/sep1752w24
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/ts/cal/sep1752w b/tests/ts/cal/sep1752w
index 494a90c7f..a3e15550d 100755
--- a/tests/ts/cal/sep1752w
+++ b/tests/ts/cal/sep1752w
@@ -26,11 +26,7 @@ USETERM=$( ts_has_option "useterm" "$*" )
MYMONTH="09 1752"
MYYEAR="1752"
-[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
-ts_log ""
-
-
-function call_cal {
+function call_cal_simple {
ts_log "$1"
shift
if [ "$USETERM" == "yes" ]; then
@@ -39,6 +35,20 @@ function call_cal {
$TS_CMD_CAL "$@" >> $TS_OUTPUT
}
+function call_cal {
+ local testname=$(echo "$2" | sed 's/-//g')
+
+ if [ "$3" == "$MYYEAR" ]; then
+ testname="${testname}-year"
+ else
+ testname="${testname}-month"
+ fi
+
+ ts_init_subtest "$testname"
+ call_cal_simple "$@"
+ ts_finalize_subtest
+}
+
call_cal "Gregorian - Monday-based month with week numbers" -1mw $MYMONTH
@@ -64,6 +74,8 @@ call_cal "Julian - Monday-based year with week numbers" -1mjw $MYYEAR
call_cal "Julian - Sunday-based year with week numbers" -1sjw $MYYEAR
-call_cal "Gregorian - address by week number" --week=40 --iso $MYYEAR
+ts_init_subtest "week-iso"
+call_cal_simple "Gregorian - address by week number" --week=40 --iso $MYYEAR
+ts_finalize_subtest
ts_finalize