summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer/files/add-a-target-to-compile-tests.patch
blob: d02d869410707a30cf8899b6ae9eb0e04f4d8368 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From d61414bc17cf2df019510c2908048c4cabf5cf09 Mon Sep 17 00:00:00 2001
From: Anuj Mittal <anuj.mittal@intel.com>
Date: Tue, 27 Feb 2018 09:27:01 +0800
Subject: [PATCH] add targets for test installation

Targets to make sure tests can be installed and then run on
the target.

Upstream-Status: Inappropriate [specific to oe setup]

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>

---
 tests/check/Makefile.am | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index 13b916d..a66786d 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -8,11 +8,7 @@ REGISTRY_ENVIRONMENT = \
 	GST_REGISTRY=$(CHECK_REGISTRY)
 
 AM_TESTS_ENVIRONMENT += \
-        GST_STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)"	\
-        $(REGISTRY_ENVIRONMENT)					\
-        GST_PLUGIN_SCANNER_1_0=$(top_builddir)/libs/gst/helpers/gst-plugin-scanner \
-        GST_PLUGIN_SYSTEM_PATH_1_0=					\
-        GST_PLUGIN_PATH_1_0=$(top_builddir)/plugins
+        GST_STATE_IGNORE_ELEMENTS="$(STATE_IGNORE_ELEMENTS)"
 
 plugindir = $(libdir)/gstreamer-@GST_API_VERSION@
 
@@ -178,6 +174,23 @@ noinst_PROGRAMS =
 
 TESTS = $(check_PROGRAMS)
 
+install-ptest: $(TESTS)
+	@$(INSTALL) -d $(DESTDIR)
+	@for dir in `find -maxdepth 1 -type d`; do \
+		if [ -x $$dir/.libs ]; then \
+			$(INSTALL) -d $(DESTDIR)/$$dir; \
+			$(INSTALL_PROGRAM) $$dir/.libs/* $(DESTDIR)/$$dir/; \
+		fi \
+	done
+
+runtests:
+	@for b in $(TESTS); do \
+		if [ -x $$b ]; then \
+			$(AM_TESTS_ENVIRONMENT) $(SHELL) test-driver --test-name "$$b" \
+			--log-file $$b.log --trs-file $$b.trs $$b; \
+		fi \
+	done
+
 noinst_HEADERS = \
 	gst/capslist.h \
 	gst/struct_arm.h \
@@ -221,9 +234,9 @@ gst_gstprintf_LDADD = \
 	$(LDADD)
 
 elements_fdsrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
-	-DTESTFILE=\"$(top_srcdir)/configure.ac\"
+	-DTESTFILE=\"Makefile\"
 elements_filesrc_CFLAGS=$(GST_OBJ_CFLAGS) $(AM_CFLAGS) \
-	-DTESTFILE=\"$(top_srcdir)/configure.ac\"
+	-DTESTFILE=\"Makefile\"
 
 libs_controller_LDADD = \
 	$(top_builddir)/libs/gst/controller/libgstcontroller-@GST_API_VERSION@.la \