summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch
blob: cb36c09bce85032187a7e761ff399ed3266487b4 (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
Add 'ptest' target to Makefile, to run tests without checking dependencies.
Add 'install-ptest' target, to copy needed files to ptest dir.

Signed-off-by: Björn Stenberg <bjst@enea.com>
Upstream-status: Pending
---
 Makefile.decl |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

--- a/Makefile.decl	2012-03-12 01:42:39.000000000 +0100
+++ b/Makefile.decl	2012-11-26 13:42:08.436865192 +0100
@@ -25,6 +25,49 @@
 test-nonrecursive:
 endif
 
+ptest: ptest-nonrecursive
+	@ for subdir in $(SUBDIRS) .; do \
+	    test -d "$$subdir" -a "$$subdir" != "." -a "$$subdir" != "po" && \
+	    ( test -d $$subdir && cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) \
+	  done
+
+ptest-nonrecursive:
+	@test -z "${TEST_PROGS}" || ${GTESTER} --keep-going --verbose ${TEST_PROGS}
+
+install-ptest: install-ptest-nonrecursive
+	@test -z "$(SUBDIRS)" || for subdir in $(SUBDIRS); do \
+	    test "$$subdir" == "." || \
+	    (cd $$subdir && $(MAKE) DESTDIR=$(DESTDIR)/$$subdir $@ ) \
+	done
+
+# install files used for ptest:
+# - copy EXTRA_DIST (for test data in glib/tests)
+# - run dist-hook (for glib/tests/bookmarks/ and glib/tests/markups)
+# - copy TEST_PROGS (the test programs)
+# - copy INSTALL_PROGS (for glib/gtester)
+# - avoid libtool wrappers by copying binaries from .libs
+# - strip Makefile: target from all Makefiles
+install-ptest-nonrecursive:
+	@mkdir -p $(DESTDIR)
+	@if [ -n "${TEST_PROGS}" ]; then \
+		if [ -n "${EXTRA_DIST}" ]; then \
+			cp ${EXTRA_DIST} $(DESTDIR); \
+		fi; \
+		grep -q dist-hook: Makefile && \
+			$(MAKE) distdir=$(DESTDIR) dist-hook; \
+		if [ -d .libs ] ; then \
+			cd .libs; \
+		fi; \
+		cp ${TEST_PROGS} $(DESTDIR); \
+	fi;
+	@if [ -n "${INSTALL_PROGS}" ]; then \
+		if [ -d .libs ]  ; then \
+			cd .libs; \
+		fi; \
+		cp ${INSTALL_PROGS} $(DESTDIR); \
+	fi
+	@test -f Makefile && sed 's/^Makefile:/_Makefile:/' <Makefile >$(DESTDIR)/Makefile
+
 # test-report: run tests in subdirs and generate report
 # perf-report: run tests in subdirs with -m perf and generate report
 # full-report: like test-report: with -m perf and -m slow