diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-03-28 12:36:23 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-03-28 18:16:38 +0100 |
commit | e3201a69ebfbeb9b199c8bb50dd2cc90845b8506 (patch) | |
tree | e7a07c1970ce13ee14eacb1e5bf7b931b197d757 /src/test/test-time-util.c | |
parent | f9b3f24463581df55af88fc119205fee9a118644 (diff) | |
download | systemd-e3201a69ebfbeb9b199c8bb50dd2cc90845b8506.tar.gz |
test: don't go through all time zones if slow tests are disabled
Let's skip going through all locally available time zones if we're built
with slow tests disabled, as that's quite slow, but do at least one test
with the UTC zone.
Diffstat (limited to 'src/test/test-time-util.c')
-rw-r--r-- | src/test/test-time-util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c index a7b2467452..4270161804 100644 --- a/src/test/test-time-util.c +++ b/src/test/test-time-util.c @@ -448,6 +448,11 @@ static void test_format_timestamp_with_tz_one(const char *tz) { TEST(FORMAT_TIMESTAMP_with_tz) { _cleanup_strv_free_ char **timezones = NULL; + test_format_timestamp_with_tz_one("UTC"); + + if (!slow_tests_enabled()) + return (void) log_tests_skipped("slow tests are disabled"); + assert_se(get_timezones(&timezones) >= 0); STRV_FOREACH(tz, timezones) test_format_timestamp_with_tz_one(*tz); @@ -896,6 +901,11 @@ static void test_parse_timestamp_with_tz_one(const char *tz) { TEST(parse_timestamp_with_tz) { _cleanup_strv_free_ char **timezones = NULL; + test_parse_timestamp_with_tz_one("UTC"); + + if (!slow_tests_enabled()) + return (void) log_tests_skipped("slow tests are disabled"); + assert_se(get_timezones(&timezones) >= 0); STRV_FOREACH(tz, timezones) test_parse_timestamp_with_tz_one(*tz); |