-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8475731
commit 584c091
Showing
5 changed files
with
110 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
option('tests', type : 'feature', value : 'auto', yield : true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* suppress warnings for deprecated API such as GValueArray | ||
* with newer GLib versions (>= 2.31.0) */ | ||
#define GLIB_DISABLE_DEPRECATION_WARNINGS | ||
|
||
#ifndef GST_PLUGIN_LOADING_WHITELIST | ||
#define GST_PLUGIN_LOADING_WHITELIST "" | ||
#endif | ||
|
||
#include <gst/audio/audio.h> | ||
#include <gst/check/gstcheck.h> | ||
|
||
GST_START_TEST(test_foo) { | ||
// nop | ||
} | ||
GST_END_TEST; | ||
|
||
static Suite *level_suite(void) { | ||
Suite *s = suite_create("ebur128"); | ||
TCase *tc_general = tcase_create("general"); | ||
|
||
suite_add_tcase(s, tc_general); | ||
tcase_add_test(tc_general, test_foo); | ||
|
||
return s; | ||
} | ||
|
||
GST_CHECK_MAIN(level); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
gstcheck_dep = dependency('gstreamer-check-1.0', fallback : ['gstreamer', 'gst_check_dep']) | ||
|
||
test_deps = [gst_dep, gstbase_dep, gstcheck_dep, gstaudio_dep] | ||
|
||
test_defines = [ | ||
'-UG_DISABLE_ASSERT', | ||
'-UG_DISABLE_CAST_CHECKS', | ||
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', | ||
#'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', | ||
'-DGST_USE_UNSTABLE_API', | ||
] | ||
|
||
pluginsdirs = [] | ||
if gst_dep.type_name() == 'pkgconfig' | ||
pbase = dependency('gstreamer-plugins-base-' + api_version, required: true) | ||
pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'), | ||
pbase.get_pkgconfig_variable('pluginsdir')] | ||
|
||
gst_plugin_scanner_dir = gst_dep.get_pkgconfig_variable('pluginscannerdir') | ||
else | ||
gst_plugin_scanner_dir = subproject('gstreamer').get_variable('gst_scanner_dir') | ||
endif | ||
gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner') | ||
|
||
|
||
tests = [ | ||
# name, skip?, extra_deps, extra_sources | ||
[ 'elements/ebur128', false, [gst_dep, gstaudio_dep, libebur128_dep] ], | ||
] | ||
|
||
|
||
foreach t : tests | ||
fname = '@0@.c'.format(t.get(0)) | ||
test_name = t.get(0).underscorify() | ||
skip_test = t.get(1, false) | ||
extra_deps = t.get(2, [ ]) | ||
extra_sources = t.get(3, [ ]) | ||
|
||
if not skip_test | ||
env = environment() | ||
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '') | ||
env.set('CK_DEFAULT_TIMEOUT', '20') | ||
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base', | ||
'gst-plugins-good@' + meson.build_root()) # 'timecode' ? | ||
env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs) | ||
env.set('GSETTINGS_BACKEND', 'memory') | ||
|
||
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name))) | ||
env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path) | ||
|
||
exe = executable(test_name, fname, extra_sources, | ||
c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines, | ||
dependencies : test_deps + extra_deps, | ||
) | ||
test(test_name, exe, env: env, timeout: 3 * 60) | ||
endif | ||
endforeach |