blob: efa004f8ce68c19beaca80ee83f0cdc04e2a510c [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001From 4dcbabebca2ad6f1fdd59ee35a858082e87db7b6 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sun, 2 May 2021 01:58:01 +0100
4Subject: [PATCH 4/4] tests: add helper script to run the installed_tests
5
6- this is a bash script that will run the installed_tests
7with some of the environment variables used in the meson
8testing framework.
9
10Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/789]
11
12Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
13---
14 subprojects/gstreamer/tests/check/meson.build | 17 +++++++++++++++++
15 .../gstreamer/tests/check/template.sh.in | 9 +++++++++
16 .../gstreamer/tests/check/template.test.in | 2 +-
17 3 files changed, 27 insertions(+), 1 deletion(-)
18 create mode 100755 subprojects/gstreamer/tests/check/template.sh.in
19
20diff --git a/subprojects/gstreamer/tests/check/meson.build b/subprojects/gstreamer/tests/check/meson.build
21index 48ec2532f8..7dc4990d4e 100644
22--- a/subprojects/gstreamer/tests/check/meson.build
23+++ b/subprojects/gstreamer/tests/check/meson.build
24@@ -185,6 +185,23 @@ foreach t : core_tests
25 install_dir: installed_tests_metadir,
26 configuration: test_conf
27 )
28+
29+ # All the tests will be deployed on the target machine and
30+ # we use the home folder ~ for the registry which will then expand at runtime.
31+ # Using the /tmp/gstreamer-1.0/@0@.registry can be problematic as it mostly
32+ # is mounted using tmpfs and if the machine crash from some reason we can lost the registry
33+ # that is useful for debug propose of the tests itself.
34+ env += {'GST_REGISTRY': '~/.cache/gstreamer-1.0/@0@.registry'.format(test_name)}
35+
36+ # Set the full path for the test it self.
37+ env += {'TEST': '@0@/@1@'.format(join_paths(prefix, installed_tests_execdir), test_name)}
38+
39+ configure_file(
40+ input : 'template.sh.in',
41+ output: test_name + '.sh',
42+ install_dir: installed_tests_execdir,
43+ configuration : env,
44+ )
45 endif
46
47 test(test_name, exe, env: env, timeout : 3 * 60)
48diff --git a/subprojects/gstreamer/tests/check/template.sh.in b/subprojects/gstreamer/tests/check/template.sh.in
49new file mode 100755
50index 0000000000..cf7d31b0ea
51--- /dev/null
52+++ b/subprojects/gstreamer/tests/check/template.sh.in
53@@ -0,0 +1,9 @@
54+#!/bin/sh
55+
56+set -ax
57+
58+CK_DEFAULT_TIMEOUT="@CK_DEFAULT_TIMEOUT@"
59+GST_PLUGIN_LOADING_WHITELIST="@GST_PLUGIN_LOADING_WHITELIST@"
60+GST_REGISTRY=@GST_REGISTRY@
61+GST_STATE_IGNORE_ELEMENTS="@GST_STATE_IGNORE_ELEMENTS@"
62+exec @TEST@
63diff --git a/subprojects/gstreamer/tests/check/template.test.in b/subprojects/gstreamer/tests/check/template.test.in
64index f701627f87..b74ef6ad73 100644
65--- a/subprojects/gstreamer/tests/check/template.test.in
66+++ b/subprojects/gstreamer/tests/check/template.test.in
67@@ -1,3 +1,3 @@
68 [Test]
69 Type=session
70-Exec=@installed_tests_dir@/@program@
71+Exec=@installed_tests_dir@/@program@.sh
72--
732.33.1
74