summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dbus/dbus/ptest.patch
blob: 263d17eff7da9955260a9ab90e3abd2836cd89f8 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Add install-ptest rules.
Change TEST_ENVIRONMENT to allow running outside build dir.

 Makefile.am                |    7 +++++++
 bus/Makefile.am            |    6 ++++++
 dbus/Makefile.am           |    6 ++++++
 doc/Makefile.am            |    4 ++++
 test/Makefile.am           |   25 ++++++++++++++++++++-----
 test/name-test/Makefile.am |    9 +++++++++
 tools/Makefile.am          |   12 ++++++++++++
 7 files changed, 64 insertions(+), 5 deletions(-)

Signed-off-by: Björn Stenberg <bjst@enea.com>
Upstream-Status: Pending

diff -ur a/Makefile.am b/Makefile.am
--- a/Makefile.am	2012-12-06 14:34:01.157414449 +0100
+++ b/Makefile.am	2012-12-06 15:21:14.447113035 +0100
@@ -30,4 +30,11 @@
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
+if DBUS_BUILD_TESTS
+install-ptest:
+	@for subdir in $(SUBDIRS); do \
+		$(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
+	done
+endif
+
 include tools/lcov.am
diff -ur a/bus/Makefile.am b/bus/Makefile.am
--- a/bus/Makefile.am	2012-12-06 14:34:01.169413931 +0100
+++ b/bus/Makefile.am	2012-12-06 15:21:14.463112346 +0100
@@ -290,3 +290,9 @@
 #### Extra dist
 
 EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
+
+if DBUS_BUILD_TESTS
+install-ptest:
+	@$(MKDIR_P) $(DESTDIR)
+	@install $(dbus_daemon_exec_PROGRAMS) $(noinst_PROGRAMS) $(DESTDIR)
+endif
diff -ur a/dbus/Makefile.am b/dbus/Makefile.am
--- a/dbus/Makefile.am	2012-12-06 14:34:01.161414276 +0100
+++ b/dbus/Makefile.am	2012-12-06 15:21:14.451112862 +0100
@@ -310,3 +310,9 @@
 update-systemd:
 	curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
 	curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h
+
+if DBUS_BUILD_TESTS
+install-ptest:
+	@$(MKDIR_P) $(DESTDIR)
+	@install $(noinst_PROGRAMS) $(DESTDIR)
+endif
diff -ur a/test/Makefile.am b/test/Makefile.am
--- a/test/Makefile.am	2012-12-06 14:34:01.165414103 +0100
+++ b/test/Makefile.am	2012-12-06 15:21:14.455112690 +0100
@@ -119,12 +119,13 @@
 	DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
 	DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
 
+ptest_run_dir = ..
+
 TESTS_ENVIRONMENT = \
-	DBUS_BLOCK_ON_ABORT=1 \
-	DBUS_FATAL_WARNINGS=1 \
-	DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
-	DBUS_TEST_DATA=@abs_top_builddir@/test/data \
-	DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
+	DBUS_FATAL_WARNINGS=0 \
+	DBUS_TEST_DAEMON=$(ptest_run_dir)/bus/dbus-daemon$(EXEEXT) \
+	DBUS_TEST_DATA=$(ptest_run_dir)/test/data \
+	DBUS_TEST_HOMEDIR=$(ptest_run_dir)/dbus \
 	$(NULL)
 
 test_corrupt_SOURCES = corrupt.c
@@ -325,3 +325,25 @@
 data/valid-config-files/system.conf: $(top_builddir)/bus/system.conf
 	$(AM_V_at)$(MKDIR_P) data/valid-config-files
 	$(AM_V_GEN)cp $< $@
+
+if DBUS_BUILD_TESTS
+install-ptest: install-ptest-nonrecursive
+	@for subdir in $(SUBDIRS); do \
+		if [ $$subdir != "." ]; then \
+			$(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
+		fi; \
+	done
+
+install-ptest-nonrecursive:
+	@$(MKDIR_P) $(DESTDIR)/data/valid-config-files/session.d
+	@for file in Makefile $(installable_tests) $(noinst_PROGRAMS) $(noinst_DATA) ; do \
+		if [ -f .libs/$$file ]; then \
+			install .libs/$$file $(DESTDIR); \
+		else \
+			install -D $${file%.in} $(DESTDIR)/$${file%.in}; \
+		fi; \
+	done;
+	@for file in $(EXTRA_DIST); do \
+		install -D ${srcdir}/$${file%.in} $(DESTDIR)/$${file%.in}; \
+	done;
+endif
diff -ur a/test/name-test/Makefile.am b/test/name-test/Makefile.am
--- a/test/name-test/Makefile.am	2012-12-06 14:34:01.169413931 +0100
+++ b/test/name-test/Makefile.am	2012-12-06 15:21:14.459112518 +0100
@@ -36,4 +36,16 @@
 test_privserver_client_LDADD=../libdbus-testutils.la
 test_autolaunch_LDADD=../libdbus-testutils.la
 
+install-ptest:
+	@$(MKDIR_P) $(DESTDIR)
+	@for file in Makefile $(noinst_PROGRAMS); do \
+		if [ -f .libs/$$file ]; then \
+			install .libs/$$file $(DESTDIR); \
+		else \
+			install $$file $(DESTDIR); \
+		fi \
+	done;
+	@for file in $(EXTRA_DIST); do \
+		cp $(srcdir)/$$file $(DESTDIR); \
+	done;
 endif
diff -ur a/tools/Makefile.am b/tools/Makefile.am
--- a/tools/Makefile.am	2012-12-06 14:34:01.161414276 +0100
+++ b/tools/Makefile.am	2012-12-06 15:21:14.455112690 +0100
@@ -78,3 +78,15 @@
 
 installcheck-local:
 	test -d $(DESTDIR)$(localstatedir)/lib/dbus
+
+if DBUS_BUILD_TESTS
+install-ptest:
+	@$(MKDIR_P) $(DESTDIR)
+	@for file in $(bin_PROGRAMS); do \
+		if [ -f .libs/$$file ]; then \
+			install .libs/$$file $(DESTDIR); \
+		else \
+			install $$file $(DESTDIR); \
+		fi; \
+	done;
+endif
diff -ur a/doc/Makefile.am b/doc/Makefile.am
--- a/doc/Makefile.am	2012-06-06 12:45:55.000000000 +0200
+++ b/doc/Makefile.am	2012-12-06 16:04:58.990070587 +0100
@@ -174,3 +174,7 @@
 
 maintainer-clean-local:
 	rm -f $(XMLTO_OUTPUT)
+
+if DBUS_BUILD_TESTS
+install-ptest:
+endif