meson test: Enable libs tests

https://bugzilla.gnome.org/show_bug.cgi?id=789064
This commit is contained in:
Mathieu Duponchelle 2017-10-16 19:51:36 +02:00
parent 4aa51c82a8
commit 58c374c8e2
4 changed files with 54 additions and 0 deletions

View file

@ -12,3 +12,5 @@ option('with-package-name', type : 'string',
description : 'package name to use in plugins')
option('with-package-origin', type : 'string', value : 'Unknown package origin',
description : 'package origin URL to use in plugins')
option('enable_gst_player_tests', type: 'boolean', value: false,
description: 'Enable GstPlayer tests that need network access')

View file

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import urllib.request
import shutil
import sys
import os
os.makedirs(os.path.dirname(sys.argv[2]), exist_ok=True)
with urllib.request.urlopen(sys.argv[1]) as response, open(sys.argv[2], 'wb') as out_file:
shutil.copyfileobj(response, out_file)

View file

@ -0,0 +1,19 @@
test_media = [
'audio.ogg',
'audio-video.ogg',
'audio-short.ogg',
'audio-video-short.ogg',
'sintel.mkv',
'test_sub.srt',
]
download_media = find_program('download-media')
foreach m: test_media
downloaded_media = custom_target(m,
input : [],
output : m,
command: [download_media, 'http://gstreamer.freedesktop.org/data/media/small/' + m, '@OUTPUT@'],
build_by_default: true,
install: false)
endforeach

View file

@ -11,6 +11,8 @@ libparser_dep = declare_dependency(link_with: libparser,
exif_dep = dependency('libexif', version : '>= 0.6.16', required : false)
enable_gst_player_tests = get_option('enable_gst_player_tests')
# name, condition when to skip the test and extra dependencies
base_tests = [
[['elements/aiffparse.c']],
@ -55,7 +57,22 @@ base_tests = [
[['elements/voaacenc.c'], not voaac_dep.found(), [voaac_dep]],
[['elements/x265enc.c'], not x265_dep.found(), [x265_dep]],
[['elements/zbar.c'], not zbar_dep.found(), [zbar_dep]],
[['libs/gstglcolorconvert.c'], not build_gstgl, [gstgl_dep]],
[['libs/gstglcontext.c'], not build_gstgl, [gstgl_dep]],
[['libs/gstglheaders.c'], not build_gstgl, [gstgl_dep]],
[['libs/gstglmatrix.c'], not build_gstgl, [gstgl_dep]],
[['libs/gstglmemory.c'], not build_gstgl, [gstgl_dep]],
[['libs/gstglquery.c'], not build_gstgl, [gstgl_dep]],
[['libs/gstglsl.c'], not build_gstgl, [gstgl_dep]],
[['libs/gstglupload.c'], not build_gstgl, [gstgl_dep]],
[['libs/h264parser.c'], false, [gstcodecparsers_dep]],
[['libs/insertbin.c'], false, [gstinsertbin_dep]],
[['libs/isoff.c'], not xml2_dep.found(), [gstisoff_dep, xml2_dep]],
[['libs/mpegts.c'], false, [gstmpegts_dep]],
[['libs/mpegvideoparser.c'], false, [gstcodecparsers_dep]],
[['libs/player.c'], not enable_gst_player_tests, [gstplayer_dep]],
[['libs/vc1parser.c'], false, [gstcodecparsers_dep]],
[['libs/vp8parser.c'], false, [gstcodecparsers_dep]],
]
test_defines = [
@ -63,6 +80,7 @@ test_defines = [
'-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
'-DTEST_PATH="' + meson.current_build_dir() + '/media"',
'-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data',
'-DGST_USE_UNSTABLE_API',
]
@ -113,3 +131,7 @@ foreach t : base_tests
test(test_name, exe, env: env, timeout: 3 * 60)
endif
endforeach
if enable_gst_player_tests
subdir ('media')
endif