tests: skip some tests when audiotestsrc is unavailable

This commit is contained in:
Wim Taymans 2024-06-18 13:23:44 +02:00
parent 47ec81408e
commit 78dd8b1d8f
5 changed files with 20 additions and 0 deletions

View file

@ -37,6 +37,10 @@ test_si_audio_adapter_setup (TestFixture * f, gconstpointer user_data)
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
if (!test_is_spa_lib_installed (&f->base, "audiotestsrc")) {
g_test_skip ("The pipewire audiotestsrc factory was not found");
return;
}
g_assert_nonnull (pw_context_load_module (f->base.server.context,
"libpipewire-module-spa-node-factory", NULL, NULL));
g_assert_nonnull (pw_context_load_module (f->base.server.context,

View file

@ -45,6 +45,10 @@ test_si_node_setup (TestFixture * f, gconstpointer user_data)
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
if (!test_is_spa_lib_installed (&f->base, "audiotestsrc")) {
g_test_skip ("The pipewire audiotestsrc factory was not found");
return;
}
g_assert_nonnull (pw_context_load_module (f->base.server.context,
"libpipewire-module-spa-node-factory", NULL, NULL));
}

View file

@ -90,6 +90,10 @@ test_si_standard_link_setup (TestFixture * f, gconstpointer user_data)
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
if (!test_is_spa_lib_installed (&f->base, "audiotestsrc")) {
g_test_skip ("The pipewire audiotestsrc factory was not found");
return;
}
g_assert_nonnull (pw_context_load_module (f->base.server.context,
"libpipewire-module-adapter", NULL, NULL));
g_assert_nonnull (pw_context_load_module (f->base.server.context,

View file

@ -66,6 +66,10 @@ test_om_interest_on_pw_props (TestFixture *f, gconstpointer user_data)
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
if (!test_is_spa_lib_installed (&f->base, "audiotestsrc")) {
g_test_skip ("The pipewire audiotestsrc factory was not found");
return;
}
g_assert_nonnull (pw_context_load_module (f->base.server.context,
"libpipewire-module-adapter", NULL, NULL));
}

View file

@ -263,6 +263,10 @@ test_enum_params_error (TestFixture *f, gconstpointer data)
g_assert_cmpint (pw_context_add_spa_lib (f->base.server.context,
"audiotestsrc", "audiotestsrc/libspa-audiotestsrc"), ==, 0);
if (!test_is_spa_lib_installed (&f->base, "audiotestsrc")) {
g_test_skip ("The pipewire audiotestsrc factory was not found");
return;
}
g_assert_nonnull (pw_context_load_module (f->base.server.context,
"libpipewire-module-adapter", NULL, NULL));
}