From f89fc3441ba97b4bebf23ff018a3b5abf12c57cf Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 7 Dec 2018 23:39:01 +0900 Subject: [PATCH] tests: Enable unit test on Windows Remove hard-coded ':' whitelist separator since it varies with OS --- meson.build | 4 +--- tests/check/meson.build | 16 +++++++++++----- tests/meson.build | 6 ++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index e45b75d..e670015 100644 --- a/meson.build +++ b/meson.build @@ -141,11 +141,9 @@ gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req, fallback : ['gst-plugins-base', 'sdp_dep']) gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req, fallback : ['gst-plugins-base', 'rtsp_dep']) -if host_machine.system() != 'windows' - gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req, +gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req, required : get_option('tests'), fallback : ['gstreamer', 'gst_check_dep']) -endif gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req, fallback : ['gstreamer', 'gst_controller_dep']) diff --git a/tests/check/meson.build b/tests/check/meson.build index 8887f62..d7678c9 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -1,12 +1,18 @@ # name, condition when to skip the test and extra dependencies ugly_tests = [ - [ 'elements/amrnbenc', not amrnb_dep.found() ], - [ 'elements/mpeg2dec', not mpeg2_dep.found(), [ gstvideo_dep ] ], - [ 'elements/x264enc', not x264_dep.found() ], [ 'elements/xingmux' ], - [ 'generic/states' ], ] +# FIXME: unistd dependency or not tested yet on windows +if host_machine.system() != 'windows' + ugly_tests += [ + [ 'elements/amrnbenc', not amrnb_dep.found() ], + [ 'elements/mpeg2dec', not mpeg2_dep.found() or not cdata.has('HAVE_UNISTD_H'), [ gstvideo_dep ] ], + [ 'elements/x264enc', not x264_dep.found() or not cdata.has('HAVE_UNISTD_H') ], + [ 'generic/states', not cdata.has('HAVE_UNISTD_H') ], + ] +endif + test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', @@ -61,7 +67,7 @@ foreach t : ugly_tests 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', 'gst-plugins-ugly@' + meson.build_root(), separator: ':') + 'gst-plugins-good', 'gst-plugins-ugly@' + meson.build_root()) env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs) env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name)) test(test_name, exe, env: env, timeout: 3 * 60) diff --git a/tests/meson.build b/tests/meson.build index 1cc032c..3714641 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,5 +1,3 @@ -if host_machine.system() != 'windows' - if not get_option('tests').disabled() and gstcheck_dep.found() - subdir('check') - endif +if not get_option('tests').disabled() and gstcheck_dep.found() + subdir('check') endif -- 2.7.4