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