Commit 7aebe608 authored by Seungha Yang's avatar Seungha Yang

tests: Enable unit test on Windows

Allow run some unit tests on Windows.
* Remove hardcoded path separator in whitelist env for Meson to choose
  OS-specific separator automatically (i.e., ';' for windows and ':' for *nix)
* Add dependency explicitly for some test cases, otherwise plugins couldn't be
  loaded on uninstalled environment of Windows.
parent 16af121a
...@@ -240,12 +240,9 @@ gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req, ...@@ -240,12 +240,9 @@ gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
fallback : ['gstreamer', 'gst_net_dep']) fallback : ['gstreamer', 'gst_net_dep'])
gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req, gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
fallback : ['gstreamer', 'gst_controller_dep']) fallback : ['gstreamer', 'gst_controller_dep'])
if host_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'),
required : get_option('tests'), fallback : ['gstreamer', 'gst_check_dep'])
fallback : ['gstreamer', 'gst_check_dep'])
endif
gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req, gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
fallback : ['gst-plugins-base', 'pbutils_dep']) fallback : ['gst-plugins-base', 'pbutils_dep'])
gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req, gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req,
......
...@@ -15,17 +15,13 @@ libparser_dep = declare_dependency(link_with : libparser, ...@@ -15,17 +15,13 @@ libparser_dep = declare_dependency(link_with : libparser,
# name, condition when to skip the test and extra dependencies # name, condition when to skip the test and extra dependencies
good_tests = [ good_tests = [
[ 'elements/audioamplify' ], [ 'elements/audiochebband', false, [gstfft_dep] ],
[ 'elements/audiochebband' ], [ 'elements/audiocheblimit', false, [gstfft_dep] ],
[ 'elements/audiocheblimit' ], [ 'elements/audioecho', false, [gstfft_dep] ],
[ 'elements/audiodynamic' ], [ 'elements/audiofirfilter', false, [gstfft_dep] ],
[ 'elements/audioecho' ], [ 'elements/audioiirfilter', false, [gstfft_dep] ],
[ 'elements/audiofirfilter' ], [ 'elements/audiowsincband', false, [gstfft_dep] ],
[ 'elements/audioiirfilter' ], [ 'elements/audiowsinclimit', false, [gstfft_dep] ],
[ 'elements/audioinvert' ],
[ 'elements/audiopanorama' ],
[ 'elements/audiowsincband' ],
[ 'elements/audiowsinclimit' ],
[ 'elements/alphacolor' ], [ 'elements/alphacolor' ],
[ 'elements/alpha' ], [ 'elements/alpha' ],
[ 'elements/aacparse', false, [libparser_dep] ], [ 'elements/aacparse', false, [libparser_dep] ],
...@@ -33,40 +29,23 @@ good_tests = [ ...@@ -33,40 +29,23 @@ good_tests = [
[ 'elements/amrparse', false, [libparser_dep] ], [ 'elements/amrparse', false, [libparser_dep] ],
[ 'elements/flacparse', false, [libparser_dep] ], [ 'elements/flacparse', false, [libparser_dep] ],
[ 'elements/mpegaudioparse', false, [libparser_dep] ], [ 'elements/mpegaudioparse', false, [libparser_dep] ],
[ 'elements/wavpackparse' ],
[ 'elements/autodetect' ], [ 'elements/autodetect' ],
[ 'elements/avimux' ],
[ 'elements/avisubtitle' ],
[ 'elements/capssetter' ],
[ 'elements/deinterlace' ], [ 'elements/deinterlace' ],
[ 'elements/dtmf' ], [ 'elements/dtmf' ],
[ 'pipelines/flacdec', not flac_dep.found() ],
[ 'elements/flvdemux' ], [ 'elements/flvdemux' ],
[ 'elements/flvmux' ], [ 'elements/flvmux' ],
[ 'elements/qtmux' ],
[ 'elements/qtdemux' ],
[ 'elements/mulawdec' ], [ 'elements/mulawdec' ],
[ 'elements/mulawenc' ], [ 'elements/mulawenc' ],
[ 'elements/gdkpixbufsink', not gdkpixbuf_dep.found(), [gdkpixbuf_dep] ],
[ 'elements/gdkpixbufoverlay', not gdkpixbuf_dep.found() ],
[ 'elements/icydemux' ], [ 'elements/icydemux' ],
[ 'elements/id3demux' ], [ 'elements/id3demux' ],
[ 'elements/imagefreeze' ], [ 'elements/imagefreeze' ],
[ 'elements/deinterleave' ], [ 'elements/deinterleave' ],
[ 'elements/interleave' ], [ 'elements/interleave' ],
[ 'elements/jpegdec', not jpeglib.found() ], [ 'elements/matroskademux', false, [gstriff_dep] ],
[ 'elements/jpegenc', not jpeglib.found() ], [ 'elements/matroskaparse', false, [gstriff_dep] ],
[ 'elements/level' ],
[ 'elements/matroskademux' ],
[ 'elements/matroskamux' ],
[ 'elements/matroskaparse' ],
[ 'elements/mpg123audiodec', not mpg123_dep.found(), [gstfft_dep]],
[ 'elements/multifile' ],
[ 'elements/splitmux' ],
[ 'elements/rganalysis' ], [ 'elements/rganalysis' ],
[ 'elements/rglimiter' ], [ 'elements/rglimiter' ],
[ 'elements/rgvolume' ], [ 'elements/rgvolume' ],
[ 'elements/rtp-payloading' ],
[ 'elements/rtph261' ], [ 'elements/rtph261' ],
[ 'elements/rtph263' ], [ 'elements/rtph263' ],
[ 'elements/rtpvp9' ], [ 'elements/rtpvp9' ],
...@@ -83,31 +62,12 @@ good_tests = [ ...@@ -83,31 +62,12 @@ good_tests = [
[ 'elements/rtpred' ], [ 'elements/rtpred' ],
[ 'elements/rtpulpfec' ], [ 'elements/rtpulpfec' ],
[ 'elements/rtpssrcdemux' ], [ 'elements/rtpssrcdemux' ],
[ 'elements/souphttpsrc', not libsoup_dep.found(), [libsoup_dep] ],
[ 'elements/spectrum' ],
[ 'elements/shapewipe' ],
[ 'elements/id3v2mux', not taglib_dep.found() ],
[ 'elements/apev2mux', not taglib_dep.found() ],
[ 'elements/udpsink' ], [ 'elements/udpsink' ],
[ 'elements/udpsrc' ],
[ 'elements/videobox' ],
[ 'elements/aspectratiocrop' ], [ 'elements/aspectratiocrop' ],
[ 'elements/videocrop' ],
[ 'elements/videofilter' ],
[ 'elements/videomixer' ],
[ 'elements/vp8enc', not vpx_dep.found() or not have_vp8_encoder ],
[ 'elements/vp8dec', not vpx_dep.found() or not have_vp8_decoder ],
[ 'elements/vp9enc', not vpx_dep.found() or not have_vp9_encoder ],
[ 'pipelines/lame', not lame_dep.found() ],
[ 'pipelines/wavenc' ], [ 'pipelines/wavenc' ],
[ 'elements/wavpackdec', not wavpack_dep.found() ], [ 'elements/wavparse', false, [gstriff_dep] ],
[ 'elements/wavpackenc', not wavpack_dep.found() ],
[ 'pipelines/wavpack', not wavpack_dep.found() ],
[ 'elements/wavparse' ],
[ 'elements/y4menc' ],
[ 'pipelines/effectv' ], [ 'pipelines/effectv' ],
[ 'elements/equalizer' ], [ 'elements/equalizer' ],
[ 'generic/states' ],
[ 'pipelines/simple-launch-lines' ], [ 'pipelines/simple-launch-lines' ],
[ 'pipelines/tagschecking' ], [ 'pipelines/tagschecking' ],
] ]
...@@ -115,6 +75,52 @@ good_tests = [ ...@@ -115,6 +75,52 @@ good_tests = [
# FIXME: valgrind elements/rtp-payloading - needs fixing # FIXME: valgrind elements/rtp-payloading - needs fixing
# elements/videocrop should be disabled since it takes way too long in valgrind # elements/videocrop should be disabled since it takes way too long in valgrind
# FIXME: unistd dependency or not tested yet on windows
if host_machine.system() != 'windows'
good_tests += [
[ 'elements/audioamplify', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/audiodynamic', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/audioinvert', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/audiopanorama', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/wavpackparse', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/avimux', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/avisubtitle', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/capssetter', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/qtmux', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/qtdemux', not cdata.has('HAVE_UNISTD_H') ],
[ 'pipelines/flacdec', not flac_dep.found() ],
[ 'elements/gdkpixbufsink', not gdkpixbuf_dep.found(), [gdkpixbuf_dep] ],
[ 'elements/gdkpixbufoverlay', not gdkpixbuf_dep.found() ],
[ 'elements/jpegdec', not jpeglib.found() ],
[ 'elements/jpegenc', not jpeglib.found() ],
[ 'elements/level', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/matroskamux', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/mpg123audiodec', not mpg123_dep.found(), [gstfft_dep]],
[ 'elements/multifile', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/splitmux', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/rtp-payloading', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/souphttpsrc', not libsoup_dep.found(), [libsoup_dep] ],
[ 'elements/spectrum', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/shapewipe', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/id3v2mux', not taglib_dep.found() ],
[ 'elements/apev2mux', not taglib_dep.found() ],
[ 'elements/udpsrc', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/videobox', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/videocrop', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/videofilter', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/videomixer', not cdata.has('HAVE_UNISTD_H') ],
[ 'elements/vp8enc', not vpx_dep.found() or not have_vp8_encoder ],
[ 'elements/vp8dec', not vpx_dep.found() or not have_vp8_decoder ],
[ 'elements/vp9enc', not vpx_dep.found() or not have_vp9_encoder ],
[ 'pipelines/lame', not lame_dep.found() ],
[ 'elements/wavpackdec', not wavpack_dep.found() ],
[ 'elements/wavpackenc', not wavpack_dep.found() ],
[ 'pipelines/wavpack', not wavpack_dep.found() ],
[ 'elements/y4menc', not cdata.has('HAVE_UNISTD_H') ],
[ 'generic/states', not cdata.has('HAVE_UNISTD_H')],
]
endif
foo=''' foo='''
if HAVE_ORC if HAVE_ORC
check_orc = orc/deinterlace orc/videomixer orc/videobox check_orc = orc/deinterlace orc/videomixer orc/videobox
...@@ -179,7 +185,7 @@ foreach t : good_tests ...@@ -179,7 +185,7 @@ foreach t : good_tests
env.set('GST_STATE_IGNORE_ELEMENTS', state_ignore_elements) env.set('GST_STATE_IGNORE_ELEMENTS', state_ignore_elements)
env.set('CK_DEFAULT_TIMEOUT', '20') env.set('CK_DEFAULT_TIMEOUT', '20')
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base', env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
'gst-plugins-good@' + meson.build_root(), separator: ':') 'gst-plugins-good@' + meson.build_root())
env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs) env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
env.set('GSETTINGS_BACKEND', 'memory') env.set('GSETTINGS_BACKEND', 'memory')
......
# FIXME: make check work on windows if not get_option('tests').disabled() and gstcheck_dep.found()
if host_system != 'windows' subdir('check')
if not get_option('tests').disabled() and gstcheck_dep.found()
subdir('check')
endif
endif endif
subdir('icles') subdir('icles')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment