diff options
Diffstat (limited to 'meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch')
-rw-r--r-- | meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch new file mode 100644 index 0000000000..ba8e410669 --- /dev/null +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-tests-add-support-for-install-the-tests.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From bfb530d2f0761f28c2645e2c45de5147b0528e4d Mon Sep 17 00:00:00 2001 | ||
2 | From: Jose Quaresma <quaresma.jose@gmail.com> | ||
3 | Date: Sun, 11 Apr 2021 19:48:13 +0100 | ||
4 | Subject: [PATCH] tests: add support for install the tests | ||
5 | |||
6 | This will provide to run the tests using the gnome-desktop-testing [1] | ||
7 | |||
8 | [1] https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests | ||
9 | |||
10 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/789] | ||
11 | |||
12 | Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> | ||
13 | --- | ||
14 | meson.build | 4 ++++ | ||
15 | meson_options.txt | 1 + | ||
16 | tests/check/meson.build | 22 +++++++++++++++++++++- | ||
17 | tests/check/template.test.in | 3 +++ | ||
18 | 4 files changed, 29 insertions(+), 1 deletion(-) | ||
19 | create mode 100644 tests/check/template.test.in | ||
20 | |||
21 | diff --git a/meson.build b/meson.build | ||
22 | index ba50005..09c7212 100644 | ||
23 | --- a/meson.build | ||
24 | +++ b/meson.build | ||
25 | @@ -664,6 +664,10 @@ if bashcomp_dep.found() | ||
26 | endif | ||
27 | endif | ||
28 | |||
29 | +installed_tests_enabled = get_option('installed_tests') | ||
30 | +installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name()) | ||
31 | +installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name()) | ||
32 | + | ||
33 | plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0') | ||
34 | |||
35 | pkgconfig = import('pkgconfig') | ||
36 | diff --git a/meson_options.txt b/meson_options.txt | ||
37 | index 39255cf..78af552 100644 | ||
38 | --- a/meson_options.txt | ||
39 | +++ b/meson_options.txt | ||
40 | @@ -16,6 +16,7 @@ option('poisoning', type : 'boolean', value : false, description : 'Enable poiso | ||
41 | option('memory-alignment', type: 'combo', | ||
42 | choices : ['1', '2', '4', '8', '16', '32', '64', '128', '256', '512', '1024', '2048', '4096', '8192', 'malloc', 'pagesize'], | ||
43 | value: 'malloc') | ||
44 | +option('installed_tests', type : 'boolean', value : false, description : 'Enable installed tests') | ||
45 | |||
46 | # Feature options | ||
47 | option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries') | ||
48 | diff --git a/tests/check/meson.build b/tests/check/meson.build | ||
49 | index 4cc4618..f290e2e 100644 | ||
50 | --- a/tests/check/meson.build | ||
51 | +++ b/tests/check/meson.build | ||
52 | @@ -128,10 +128,16 @@ test_defines = [ | ||
53 | '-UG_DISABLE_ASSERT', | ||
54 | '-UG_DISABLE_CAST_CHECKS', | ||
55 | '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', | ||
56 | - '-DTESTFILE="' + fsmod.as_posix(meson.current_source_dir()) + '/meson.build"', | ||
57 | '-DGST_DISABLE_DEPRECATED', | ||
58 | ] | ||
59 | |||
60 | +testfile = meson.current_source_dir() + '/meson.build' | ||
61 | +if installed_tests_enabled | ||
62 | + install_data(testfile, install_dir : installed_tests_metadir, rename : 'testfile') | ||
63 | + testfile = installed_tests_metadir + '/testfile' | ||
64 | +endif | ||
65 | +test_defines += '-DTESTFILE="@0@"'.format(testfile) | ||
66 | + | ||
67 | # sanity checking | ||
68 | if get_option('check').disabled() | ||
69 | if get_option('tests').enabled() | ||
70 | @@ -154,6 +160,8 @@ foreach t : core_tests | ||
71 | include_directories : [configinc], | ||
72 | link_with : link_with_libs, | ||
73 | dependencies : gst_deps + test_deps, | ||
74 | + install_dir: installed_tests_execdir, | ||
75 | + install: installed_tests_enabled, | ||
76 | ) | ||
77 | |||
78 | env = environment() | ||
79 | @@ -165,6 +173,18 @@ foreach t : core_tests | ||
80 | env.set('GST_PLUGIN_SCANNER_1_0', gst_scanner_dir + '/gst-plugin-scanner') | ||
81 | env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer') | ||
82 | |||
83 | + if installed_tests_enabled | ||
84 | + test_conf = configuration_data() | ||
85 | + test_conf.set('installed_tests_dir', join_paths(prefix, installed_tests_execdir)) | ||
86 | + test_conf.set('program', test_name) | ||
87 | + configure_file( | ||
88 | + input: 'template.test.in', | ||
89 | + output: test_name + '.test', | ||
90 | + install_dir: installed_tests_metadir, | ||
91 | + configuration: test_conf | ||
92 | + ) | ||
93 | + endif | ||
94 | + | ||
95 | test(test_name, exe, env: env, timeout : 3 * 60) | ||
96 | endif | ||
97 | endforeach | ||
98 | diff --git a/tests/check/template.test.in b/tests/check/template.test.in | ||
99 | new file mode 100644 | ||
100 | index 0000000..f701627 | ||
101 | --- /dev/null | ||
102 | +++ b/tests/check/template.test.in | ||
103 | @@ -0,0 +1,3 @@ | ||
104 | +[Test] | ||
105 | +Type=session | ||
106 | +Exec=@installed_tests_dir@/@program@ | ||