mu-view: check for timezone availability in tests
This commit is contained in:
@ -244,6 +244,12 @@ static std::string msgpath;
|
|||||||
static void
|
static void
|
||||||
test_view_plain()
|
test_view_plain()
|
||||||
{
|
{
|
||||||
|
TempTz tz("Europe/Amsterdam");
|
||||||
|
if (!tz.available()) {
|
||||||
|
g_test_skip("timezone not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto res = run_command({MU_PROGRAM, "view", msgpath});
|
auto res = run_command({MU_PROGRAM, "view", msgpath});
|
||||||
assert_valid_command(res);
|
assert_valid_command(res);
|
||||||
auto output{*res};
|
auto output{*res};
|
||||||
@ -263,6 +269,12 @@ text
|
|||||||
static void
|
static void
|
||||||
test_view_html()
|
test_view_html()
|
||||||
{
|
{
|
||||||
|
TempTz tz("Europe/Amsterdam");
|
||||||
|
if (!tz.available()) {
|
||||||
|
g_test_skip("timezone not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto res = run_command({MU_PROGRAM, "view", "--format=html", msgpath});
|
auto res = run_command({MU_PROGRAM, "view", "--format=html", msgpath});
|
||||||
assert_valid_command(res);
|
assert_valid_command(res);
|
||||||
auto output{*res};
|
auto output{*res};
|
||||||
@ -282,6 +294,12 @@ html
|
|||||||
static void
|
static void
|
||||||
test_view_sexp()
|
test_view_sexp()
|
||||||
{
|
{
|
||||||
|
TempTz tz("Europe/Amsterdam");
|
||||||
|
if (!tz.available()) {
|
||||||
|
g_test_skip("timezone not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto res = run_command({MU_PROGRAM, "view", "--format=sexp", msgpath});
|
auto res = run_command({MU_PROGRAM, "view", "--format=sexp", msgpath});
|
||||||
assert_valid_command(res);
|
assert_valid_command(res);
|
||||||
auto output{*res};
|
auto output{*res};
|
||||||
@ -312,8 +330,6 @@ main(int argc, char* argv[]) try {
|
|||||||
strm.close();
|
strm.close();
|
||||||
g_assert_true(strm.good());
|
g_assert_true(strm.good());
|
||||||
|
|
||||||
set_tz("Europe/Amsterdam");
|
|
||||||
|
|
||||||
mu_test_init(&argc, &argv);
|
mu_test_init(&argc, &argv);
|
||||||
|
|
||||||
g_test_add_func("/cmd/view/plain", test_view_plain);
|
g_test_add_func("/cmd/view/plain", test_view_plain);
|
||||||
|
|||||||
Reference in New Issue
Block a user