summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2018-05-25 14:20:03 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-18 11:07:57 +0100
commit760127420cec852da7e8e72661c9ff70fa1c97c5 (patch)
treeb829a3b3965a225840029169ebef641bc5b60206 /meta/recipes-multimedia/gstreamer
parentc7fbb0251bf560c3e9ac847696e8a735dc8ee787 (diff)
downloadpoky-760127420cec852da7e8e72661c9ff70fa1c97c5.tar.gz
gstreamer: enable ptest support
Make sure that the tests are packaged and can be executed when ptest is enabled. Also, remove build host specific references from Makefile. (From OE-Core rev: d283b0eb909c78b020794ba78e7ec64c3fbee86f) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/gstreamer')
-rw-r--r--meta/recipes-multimedia/gstreamer/files/add-a-target-to-compile-tests.patch69
-rw-r--r--meta/recipes-multimedia/gstreamer/files/run-ptest3
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0_1.14.0.bb26
3 files changed, 96 insertions, 2 deletions
diff --git a/meta/recipes-multimedia/gstreamer/files/add-a-target-to-compile-tests.patch b/meta/recipes-multimedia/gstreamer/files/add-a-target-to-compile-tests.patch
new file mode 100644
index 0000000000..d02d869410
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/files/add-a-target-to-compile-tests.patch
@@ -0,0 +1,69 @@
1From d61414bc17cf2df019510c2908048c4cabf5cf09 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anuj.mittal@intel.com>
3Date: Tue, 27 Feb 2018 09:27:01 +0800
4Subject: [PATCH] add targets for test installation
5
6Targets to make sure tests can be installed and then run on
7the target.
8
9Upstream-Status: Inappropriate [specific to oe setup]
10
11Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
12
13---
14 tests/check/Makefile.am | 27 ++++++++++++++++++++-------
15 1 file changed, 20 insertions(+), 7 deletions(-)
16
17diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
18index 13b916d..a66786d 100644
19--- a/tests/check/Makefile.am
20+++ b/tests/check/Makefile.am
21@@ -8,11 +8,7 @@ REGISTRY_ENVIRONMENT = \
22 GST_REGISTRY=$(CHECK_REGISTRY)
23
24 AM_TESTS_ENVIRONMENT += \
25- GST_STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)" \
26- $(REGISTRY_ENVIRONMENT) \
27- GST_PLUGIN_SCANNER_1_0=$(top_builddir)/libs/gst/helpers/gst-plugin-scanner \
28- GST_PLUGIN_SYSTEM_PATH_1_0= \
29- GST_PLUGIN_PATH_1_0=$(top_builddir)/plugins
30+ GST_STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)"
31
32 plugindir = $(libdir)/gstreamer-@GST_API_VERSION@
33
34@@ -178,6 +174,23 @@ noinst_PROGRAMS =
35
36 TESTS = $(check_PROGRAMS)
37
38+install-ptest: $(TESTS)
39+ @$(INSTALL) -d $(DESTDIR)
40+ @for dir in `find -maxdepth 1 -type d`; do \
41+ if [ -x $$dir/.libs ]; then \
42+ $(INSTALL) -d $(DESTDIR)/$$dir; \
43+ $(INSTALL_PROGRAM) $$dir/.libs/* $(DESTDIR)/$$dir/; \
44+ fi \
45+ done
46+
47+runtests:
48+ @for b in $(TESTS); do \
49+ if [ -x $$b ]; then \
50+ $(AM_TESTS_ENVIRONMENT) $(SHELL) test-driver --test-name "$$b" \
51+ --log-file $$b.log --trs-file $$b.trs $$b; \
52+ fi \
53+ done
54+
55 noinst_HEADERS = \
56 gst/capslist.h \
57 gst/struct_arm.h \
58@@ -221,9 +234,9 @@ gst_gstprintf_LDADD = \
59 $(LDADD)
60
61 elements_fdsrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
62- -DTESTFILE=\"$(top_srcdir)/configure.ac\"
63+ -DTESTFILE=\"Makefile\"
64 elements_filesrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
65- -DTESTFILE=\"$(top_srcdir)/configure.ac\"
66+ -DTESTFILE=\"Makefile\"
67
68 libs_controller_LDADD = \
69 $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_API_VERSION@.la \
diff --git a/meta/recipes-multimedia/gstreamer/files/run-ptest b/meta/recipes-multimedia/gstreamer/files/run-ptest
new file mode 100644
index 0000000000..473d0b67a7
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/files/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make -k runtests
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.14.0.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.14.0.bb
index dec1783fdd..5ce9f24efe 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.14.0.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.14.0.bb
@@ -8,7 +8,7 @@ LICENSE = "LGPLv2+"
8 8
9DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native" 9DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native"
10 10
11inherit autotools pkgconfig gettext upstream-version-is-even gobject-introspection gtk-doc 11inherit autotools pkgconfig gettext upstream-version-is-even gobject-introspection gtk-doc ptest
12 12
13# This way common/m4/introspection.m4 will come first 13# This way common/m4/introspection.m4 will come first
14# (it has a custom INTROSPECTION_INIT macro, and so must be used instead of our common introspection.m4 file) 14# (it has a custom INTROSPECTION_INIT macro, and so must be used instead of our common introspection.m4 file)
@@ -24,11 +24,14 @@ SRC_URI = " \
24 file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \ 24 file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
25 file://gtk-doc-tweaks.patch \ 25 file://gtk-doc-tweaks.patch \
26 file://0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch \ 26 file://0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch \
27 file://add-a-target-to-compile-tests.patch \
28 file://run-ptest \
27" 29"
28SRC_URI[md5sum] = "63c7cbfb86aa28c4522e374dc5555b96" 30SRC_URI[md5sum] = "63c7cbfb86aa28c4522e374dc5555b96"
29SRC_URI[sha256sum] = "fc361367f0d4b780a868a8833f9f30b9c9f4ac9faea4e6b251db8b4b0398466e" 31SRC_URI[sha256sum] = "fc361367f0d4b780a868a8833f9f30b9c9f4ac9faea4e6b251db8b4b0398466e"
30 32
31PACKAGECONFIG ??= "" 33PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
34 "
32 35
33PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" 36PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
34PACKAGECONFIG[tests] = "--enable-tests,--disable-tests" 37PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
@@ -54,6 +57,7 @@ FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions/ ${datadi
54 57
55RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi" 58RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
56RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi" 59RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
60RDEPENDS_${PN}-ptest += "make"
57 61
58delete_pkg_m4_file() { 62delete_pkg_m4_file() {
59 # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection 63 # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
@@ -67,4 +71,22 @@ do_compile_prepend() {
67 export GIR_EXTRA_LIBS_PATH="${B}/gst/.libs:${B}/libs/gst/base/.libs" 71 export GIR_EXTRA_LIBS_PATH="${B}/gst/.libs:${B}/libs/gst/base/.libs"
68} 72}
69 73
74do_compile_ptest() {
75 oe_runmake build-checks
76}
77
78do_install_ptest() {
79 oe_runmake -C tests/check DESTDIR=${D}${PTEST_PATH} install-ptest
80 install -m 644 ${B}/tests/check/Makefile ${D}${PTEST_PATH}
81 install -m 755 ${S}/test-driver ${D}${PTEST_PATH}
82 sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
83 -e 's|${DEBUG_PREFIX_MAP}||g' \
84 -e 's:${HOSTTOOLS_DIR}/::g' \
85 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
86 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \-e 's/^Makefile:/_Makefile:/' \
87 -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' \
88 -e 's/^builddir = \(.*\)/builddir = ./' -e 's/^top_builddir = \(.*\)/top_builddir = ./' \
89 -i ${D}${PTEST_PATH}/Makefile
90}
91
70CVE_PRODUCT = "gstreamer" 92CVE_PRODUCT = "gstreamer"