From 5c8324fb88080238786c8ae31bc5640d9b7e9bd6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 22 Jan 2018 15:01:05 +0100 Subject: tests: use subtests for sep1752w test Signed-off-by: Karel Zak --- tests/ts/cal/sep1752w | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'tests/ts/cal') 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 -- cgit v1.2.3-55-g7522