summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dbus
diff options
context:
space:
mode:
authorBjörn Stenberg <bjst@enea.com>2012-12-20 14:53:13 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-26 11:34:05 +0000
commit0c7da2f1467e01d87c20ca5d033d1d3838e10f79 (patch)
treea36df965e0e5f0d692040af1e75764f3d4955c2c /meta/recipes-core/dbus
parentddce381e78c92e0881c73f21d97af0264b3d47e0 (diff)
downloadpoky-0c7da2f1467e01d87c20ca5d033d1d3838e10f79.tar.gz
Add ptest for dbus.
This patch adds a new recipe dbus-test to build and package the dbus test suite. The reason for a separate recipe is that the dbus test suite depends on dbus-glib, so it cannot be compiled at the same time as dbus. (From OE-Core rev: 280e79adea4536b264a526072406d605d0822e7d) Signed-off-by: Björn Stenberg <bjst@enea.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/dbus')
-rw-r--r--meta/recipes-core/dbus/dbus-1.6.4/ptest.patch144
-rwxr-xr-xmeta/recipes-core/dbus/dbus-1.6.4/run-ptest3
-rw-r--r--meta/recipes-core/dbus/dbus-1.6.4/test-run-path.patch26
-rw-r--r--meta/recipes-core/dbus/dbus-ptest_1.6.4.bb46
-rw-r--r--meta/recipes-core/dbus/dbus.inc2
5 files changed, 221 insertions, 0 deletions
diff --git a/meta/recipes-core/dbus/dbus-1.6.4/ptest.patch b/meta/recipes-core/dbus/dbus-1.6.4/ptest.patch
new file mode 100644
index 0000000000..106bfb4c57
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-1.6.4/ptest.patch
@@ -0,0 +1,144 @@
1Add install-ptest rules.
2Change TEST_ENVIRONMENT to allow running outside build dir.
3
4 Makefile.am | 7 +++++++
5 bus/Makefile.am | 6 ++++++
6 dbus/Makefile.am | 6 ++++++
7 doc/Makefile.am | 4 ++++
8 test/Makefile.am | 25 ++++++++++++++++++++-----
9 test/name-test/Makefile.am | 9 +++++++++
10 tools/Makefile.am | 12 ++++++++++++
11 7 files changed, 64 insertions(+), 5 deletions(-)
12
13Signed-off-by: Björn Stenberg <bjst@enea.com>
14Upstream-Status: Pending
15
16diff -ur a/Makefile.am b/Makefile.am
17--- a/Makefile.am 2012-12-06 14:34:01.157414449 +0100
18+++ b/Makefile.am 2012-12-06 15:21:14.447113035 +0100
19@@ -30,4 +30,11 @@
20
21 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22
23+if DBUS_BUILD_TESTS
24+install-ptest:
25+ @for subdir in $(SUBDIRS); do \
26+ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
27+ done
28+endif
29+
30 include tools/lcov.am
31diff -ur a/bus/Makefile.am b/bus/Makefile.am
32--- a/bus/Makefile.am 2012-12-06 14:34:01.169413931 +0100
33+++ b/bus/Makefile.am 2012-12-06 15:21:14.463112346 +0100
34@@ -290,3 +290,9 @@
35 #### Extra dist
36
37 EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
38+
39+if DBUS_BUILD_TESTS
40+install-ptest:
41+ @$(MKDIR_P) $(DESTDIR)
42+ @install $(dbus_daemon_exec_PROGRAMS) $(noinst_PROGRAMS) $(DESTDIR)
43+endif
44diff -ur a/dbus/Makefile.am b/dbus/Makefile.am
45--- a/dbus/Makefile.am 2012-12-06 14:34:01.161414276 +0100
46+++ b/dbus/Makefile.am 2012-12-06 15:21:14.451112862 +0100
47@@ -310,3 +310,9 @@
48 update-systemd:
49 curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
50 curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h
51+
52+if DBUS_BUILD_TESTS
53+install-ptest:
54+ @$(MKDIR_P) $(DESTDIR)
55+ @install $(noinst_PROGRAMS) $(DESTDIR)
56+endif
57diff -ur a/test/Makefile.am b/test/Makefile.am
58--- a/test/Makefile.am 2012-12-06 14:34:01.165414103 +0100
59+++ b/test/Makefile.am 2012-12-06 15:21:14.455112690 +0100
60@@ -119,12 +119,13 @@
61 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
62 DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
63
64+ptest_run_dir = ..
65+
66 TESTS_ENVIRONMENT = \
67- DBUS_BLOCK_ON_ABORT=1 \
68- DBUS_FATAL_WARNINGS=1 \
69- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
70- DBUS_TEST_DATA=@abs_top_builddir@/test/data \
71- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
72+ DBUS_FATAL_WARNINGS=0 \
73+ DBUS_TEST_DAEMON=$(ptest_run_dir)/bus/dbus-daemon$(EXEEXT) \
74+ DBUS_TEST_DATA=$(ptest_run_dir)/test/data \
75+ DBUS_TEST_HOMEDIR=$(ptest_run_dir)/dbus \
76 $(NULL)
77
78 test_corrupt_SOURCES = corrupt.c
79@@ -325,3 +326,18 @@
80 data/valid-config-files/system.conf: $(top_builddir)/bus/system.conf
81 $(AM_V_at)$(MKDIR_P) data/valid-config-files
82 $(AM_V_GEN)cp $< $@
83+
84+if DBUS_BUILD_TESTS
85+install-ptest: install-ptest-nonrecursive
86+ @for subdir in $(SUBDIRS); do \
87+ if [ $$subdir != "." ]; then \
88+ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
89+ fi; \
90+ done
91+
92+install-ptest-nonrecursive:
93+ @$(MKDIR_P) $(DESTDIR)/data/valid-config-files/session.d
94+ @for file in Makefile $(installable_tests) $(EXTRA_DIST) $(noinst_DATA); do \
95+ install -D $${file%.in} $(DESTDIR)/$${file%.in}; \
96+ done;
97+endif
98diff -ur a/test/name-test/Makefile.am b/test/name-test/Makefile.am
99--- a/test/name-test/Makefile.am 2012-12-06 14:34:01.169413931 +0100
100+++ b/test/name-test/Makefile.am 2012-12-06 15:21:14.459112518 +0100
101@@ -36,4 +36,13 @@
102 test_privserver_client_LDADD=../libdbus-testutils.la
103 test_autolaunch_LDADD=../libdbus-testutils.la
104
105+install-ptest:
106+ @$(MKDIR_P) $(DESTDIR)
107+ @for file in Makefile $(noinst_PROGRAMS) $(EXTRA_DIST); do \
108+ if [ -f .libs/$$file ]; then \
109+ install .libs/$$file $(DESTDIR); \
110+ else \
111+ install $$file $(DESTDIR); \
112+ fi \
113+ done;
114 endif
115diff -ur a/tools/Makefile.am b/tools/Makefile.am
116--- a/tools/Makefile.am 2012-12-06 14:34:01.161414276 +0100
117+++ b/tools/Makefile.am 2012-12-06 15:21:14.455112690 +0100
118@@ -78,3 +78,15 @@
119
120 installcheck-local:
121 test -d $(DESTDIR)$(localstatedir)/lib/dbus
122+
123+if DBUS_BUILD_TESTS
124+install-ptest:
125+ @$(MKDIR_P) $(DESTDIR)
126+ @for file in $(bin_PROGRAMS); do \
127+ if [ -f .libs/$$file ]; then \
128+ install .libs/$$file $(DESTDIR); \
129+ else \
130+ install $$file $(DESTDIR); \
131+ fi; \
132+ done;
133+endif
134diff -ur a/doc/Makefile.am b/doc/Makefile.am
135--- a/doc/Makefile.am 2012-06-06 12:45:55.000000000 +0200
136+++ b/doc/Makefile.am 2012-12-06 16:04:58.990070587 +0100
137@@ -174,3 +174,7 @@
138
139 maintainer-clean-local:
140 rm -f $(XMLTO_OUTPUT)
141+
142+if DBUS_BUILD_TESTS
143+install-ptest:
144+endif
diff --git a/meta/recipes-core/dbus/dbus-1.6.4/run-ptest b/meta/recipes-core/dbus/dbus-1.6.4/run-ptest
new file mode 100755
index 0000000000..e08ecb1a63
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-1.6.4/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2cd test
3make -k runtest-TESTS
diff --git a/meta/recipes-core/dbus/dbus-1.6.4/test-run-path.patch b/meta/recipes-core/dbus/dbus-1.6.4/test-run-path.patch
new file mode 100644
index 0000000000..5c08c9354a
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-1.6.4/test-run-path.patch
@@ -0,0 +1,26 @@
1
2
3Signed-off-by: Björn Stenberg <bjst@enea.com>
4Upstream-Status: Pending
5
6--- a/test/Makefile.am 2012-06-15 15:25:43.000000000 +0200
7+++ b/test/Makefile.am 2012-11-16 09:24:44.263140840 +0100
8@@ -119,12 +119,13 @@
9 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
10 DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
11
12+ptest_run_dir = ..
13+
14 TESTS_ENVIRONMENT = \
15- DBUS_BLOCK_ON_ABORT=1 \
16- DBUS_FATAL_WARNINGS=1 \
17- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
18- DBUS_TEST_DATA=@abs_top_builddir@/test/data \
19- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
20+ DBUS_FATAL_WARNINGS=0 \
21+ DBUS_TEST_DAEMON=$(ptest_run_dir)/bus/dbus-daemon$(EXEEXT) \
22+ DBUS_TEST_DATA=$(ptest_run_dir)/test/data \
23+ DBUS_TEST_HOMEDIR=$(ptest_run_dir)/dbus \
24 $(NULL)
25
26 test_corrupt_SOURCES = corrupt.c
diff --git a/meta/recipes-core/dbus/dbus-ptest_1.6.4.bb b/meta/recipes-core/dbus/dbus-ptest_1.6.4.bb
new file mode 100644
index 0000000000..2982439c9a
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-ptest_1.6.4.bb
@@ -0,0 +1,46 @@
1DESCRIPTION = "D-Bus test package, only used for D-bus functionality test."
2HOMEPAGE = "http://dbus.freedesktop.org"
3SECTION = "base"
4LICENSE = "AFL-2 | GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
6 file://dbus/dbus.h;firstline=6;endline=20;md5=6eea2e0c7750dd8e620dcb1437312fa5"
7
8DEPENDS = "python-pygobject dbus dbus-glib"
9
10RDEPENDS = "make"
11
12SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
13 file://tmpdir.patch \
14 file://ptest.patch \
15 file://dbus-1.init \
16 file://run-ptest \
17 "
18
19SRC_URI[md5sum] = "5ec43dc4554cba638917317b2b4f7640"
20SRC_URI[sha256sum] = "5fba6b7a415d761a843fb8e0aee72db61cf13057a9ef8cdc795e5d369dc74cf1"
21
22S="${WORKDIR}/dbus-${PV}"
23FILESPATH = "${FILE_DIRNAME}/dbus-${PV}"
24
25inherit autotools pkgconfig gettext ptest
26
27EXTRA_OECONF_X = "${@base_contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
28EXTRA_OECONF_X_virtclass-native = "--without-x"
29
30EXTRA_OECONF = "--enable-tests \
31 --enable-modular-tests \
32 --enable-installed-tests \
33 --enable-checks \
34 --enable-asserts \
35 --enable-verbose-mode \
36 --disable-xml-docs \
37 --disable-doxygen-docs \
38 --disable-libaudit \
39 --with-xml=expat \
40 --with-systemdsystemunitdir=${systemd_unitdir}/system/ \
41 ${EXTRA_OECONF_X}"
42
43do_install() {
44 ptest_do_install
45 find ${D}${PTEST_PATH} -name Makefile | xargs sed -i 's/^Makefile:/_Makefile:/'
46}
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index d165cdd878..68f5e40097 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -9,6 +9,8 @@ X11DEPENDS = "virtual/libx11 libsm"
9DEPENDS = "expat virtual/libintl ${@base_contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)}" 9DEPENDS = "expat virtual/libintl ${@base_contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)}"
10DEPENDS_class-native = "expat-native virtual/libintl-native" 10DEPENDS_class-native = "expat-native virtual/libintl-native"
11DEPENDS_class-nativesdk = "nativesdk-expat virtual/nativesdk-libintl virtual/libx11" 11DEPENDS_class-nativesdk = "nativesdk-expat virtual/nativesdk-libintl virtual/libx11"
12RDEPENDS_dbus = "${@base_contains('DISTRO_FEATURES', 'ptest', 'dbus-ptest', '', d)}"
13RDEPENDS_class-native = ""
12 14
13INC_PR = "r5" 15INC_PR = "r5"
14 16