Skip to content

Commit

Permalink
tests: disable only sound-related notification tests if without wavparse
Browse files Browse the repository at this point in the history
Only sound-related tests require gstreamer wavparse plugin for
validation, so it's okay to disable test_notification_sound but keep
other notification tests.

This also fixes link failures when wavparse isn't available: we
previously excluded notification.c from the source list in the missing
case, but still used test_notification_* symbols in test-portals.c.

Fixes: 1c6dd18 ("tests: Check for required WAV decoder for notification tests")
Signed-off-by: Yao Zi <[email protected]>
  • Loading branch information
ziyao233 authored and smcv committed Jan 8, 2025
1 parent cb16d56 commit a18f69f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ if gst_inspect.found()
else
have_wav_parse = false
endif
if have_wav_parse
config_h.set('HAVE_WAV_PARSE', 1)
endif

bwrap = find_program('bwrap', required: get_option('sandboxed-image-validation').allowed() or get_option('sandboxed-sound-validation').allowed())

Expand Down
7 changes: 1 addition & 6 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ if have_libportal
'email.c',
'filechooser.c',
'inhibit.c',
'notification.c',
'openuri.c',
'print.c',
'screenshot.c',
Expand All @@ -110,12 +111,6 @@ if have_libportal
)
endif

if have_wav_parse
portals_test_sources += files(
'notification.c',
)
endif

test_portals = executable(
'test-portals',
'test-portals.c',
Expand Down
5 changes: 5 additions & 0 deletions tests/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ test_sound (const char *serialized_sound,
static void
test_file_sound (void)
{
#ifndef HAVE_WAV_PARSE
g_test_skip("wavparse isn't available");
return;
#endif

g_autoptr(GError) error = NULL;
g_autofree char *uri = NULL;
g_autofree char *serialized_sound_s = NULL;
Expand Down

0 comments on commit a18f69f

Please sign in to comment.