Patchwork [4/5] Add ptest for dbus.

login
register
mail settings
Submitter Björn Stenberg
Date Dec. 19, 2012, 4:18 p.m.
Message ID <1355933911-48562-5-git-send-email-bjst@enea.com>
Download mbox | patch
Permalink /patch/41343/
State New
Headers show

Comments

Björn Stenberg - Dec. 19, 2012, 4:18 p.m.
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.

Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 meta/recipes-core/dbus/dbus-1.6.4/ptest.patch      |  144 ++++++++++++++++++++
 meta/recipes-core/dbus/dbus-1.6.4/run-ptest        |    3 +
 .../dbus/dbus-1.6.4/test-run-path.patch            |   26 ++++
 meta/recipes-core/dbus/dbus-ptest_1.6.4.bb         |   46 ++++++
 meta/recipes-core/dbus/dbus.inc                    |    2 +
 5 files changed, 221 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-core/dbus/dbus-1.6.4/ptest.patch
 create mode 100755 meta/recipes-core/dbus/dbus-1.6.4/run-ptest
 create mode 100644 meta/recipes-core/dbus/dbus-1.6.4/test-run-path.patch
 create mode 100644 meta/recipes-core/dbus/dbus-ptest_1.6.4.bb
Marcin Juszkiewicz - Dec. 19, 2012, 5:38 p.m.
W dniu 19.12.2012 17:18, Björn Stenberg pisze:
> 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.

Failed here:

18:33 hrw@puchatek:build$ bitbake linaro-image-sdk
Loading cache: 100% |###############################################################################################################################| ETA:  00:00:00
Loaded 1891 entries from dependency cache.
Parsing recipes: 100% |#############################################################################################################################| Time: 00:00:04
Parsing of 1515 .bb files complete (1507 cached, 8 parsed). 1899 targets, 62 skipped, 0 masked, 0 errors.

Build Configuration:
BB_VERSION        = "1.17.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-13.04"
TARGET_SYS        = "aarch64-oe-linux"
MACHINE           = "genericarmv8"
DISTRO_VERSION    = "oe-core.0"
TUNE_FEATURES     = "aarch64"
meta-oe           
meta-webserver    
toolchain-layer   
meta-gnome        = "meta-oe:ef5e1d752003e70d30ce8462c3cd09ce3794d783"
meta-aarch64      = "master:c2d418c1da9c21c408511399b85861bcde8cffe3"
meta-linaro       = "master:02a6a819c86ac95c57526ad93a81a63ca6649b35"
meta              = "master:413ab5e9f525b02c2e8a701e96aee6b1c84c4939"
meta-efl          
meta-gpe          
meta-initramfs    
meta-multimedia   
meta-networking   
meta-xfce         = "meta-oe:ef5e1d752003e70d30ce8462c3cd09ce3794d783"

NOTE: Resolving any missing task queue dependencies
NOTE: multiple providers are available for jpeg (jpeg, libjpeg-turbo)
NOTE: consider defining a PREFERRED_PROVIDER entry to match jpeg
NOTE: multiple providers are available for jpeg-native (jpeg-native, libjpeg-turbo-native)
NOTE: consider defining a PREFERRED_PROVIDER entry to match jpeg-native
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Error executing a python function in /home/hrw/HDD/devel/canonical/aarch64/CLEAN/openembedded-core/meta/recipes-core/dbus/dbus_1.6.4.bb:
ExpansionError: Failure expanding variable RDEPENDS_dbus-lib, expression was 'ptest' 'dbus-ptest' ${@base_contains('DISTRO_FEATURES' '' d)} eglibc (>= 2.16) libgcc 
(>= linaro-4.7) which triggered exception SyntaxError: invalid syntax (RDEPENDS_dbus-lib, line 1)

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR:   File "package_depchains", line 128, in <module>
ERROR: 
ERROR:   File "package_depchains", line 75, in package_depchains
ERROR: 
ERROR:   File "/home/hrw/HDD/devel/canonical/aarch64/CLEAN/openembedded-core/bitbake/lib/bb/data_smart.py", line 295, in getVar
ERROR:     return self.expand(value, var)
ERROR: 
ERROR:   File "/home/hrw/HDD/devel/canonical/aarch64/CLEAN/openembedded-core/bitbake/lib/bb/data_smart.py", line 159, in expand
ERROR:     return self.expandWithRefs(s, varname).value
ERROR: 
ERROR:   File "/home/hrw/HDD/devel/canonical/aarch64/CLEAN/openembedded-core/bitbake/lib/bb/data_smart.py", line 149, in expandWithRefs
ERROR:     raise ExpansionError(varname, s, exc)
ERROR: 
ERROR: The code that was being executed was:
ERROR:      0124:                    add_dep(rdeps, dep)
ERROR:      0125:                pkg_addrrecs(pkg, base, suffix, func, rdeps, d)
ERROR:      0126:
ERROR:      0127:
ERROR:  *** 0128:package_depchains(d)
ERROR:      0129:
ERROR: [From file: 'package_depchains', lineno: 128, function: <module>]
ERROR:      0071:    for dep in bb.utils.explode_deps(d.getVar('RDEPENDS', True) or ""):
ERROR:      0072:        add_dep(rdepends, dep)
ERROR:      0073:
ERROR:      0074:    for pkg in packages.split():
ERROR:  *** 0075:        for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg, True) or ""):
ERROR:      0076:            add_dep(rdepends, dep)
ERROR:      0077:
ERROR:      0078:    #bb.note('rdepends is %s' % rdepends)
ERROR:      0079:
ERROR: [From file: 'package_depchains', lineno: 75, function: package_depchains]
ERROR: Function failed: package_depchains
ERROR: Logfile of failure stored in: /home/hrw/HDD/devel/canonical/aarch64/CLEAN/build/tmp-eglibc/work/aarch64-oe-linux/dbus/1.6.4-r5.0/temp/log.do_package.9925
ERROR: Task 1880 (/home/hrw/HDD/devel/canonical/aarch64/CLEAN/openembedded-core/meta/recipes-core/dbus/dbus_1.6.4.bb, do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2799 tasks of which 2792 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/hrw/HDD/devel/canonical/aarch64/CLEAN/openembedded-core/meta/recipes-core/dbus/dbus_1.6.4.bb, do_package
Summary: There were 34 ERROR messages shown, returning a non-zero exit code.
Björn Stenberg - Dec. 20, 2012, 2:32 p.m.
Marcin Juszkiewicz wrote:
> ExpansionError: Failure expanding variable RDEPENDS_dbus-lib

Ehm, how embarrassing. I have now posted an updated patch.

Patch

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 0000000..106bfb4
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-1.6.4/ptest.patch
@@ -0,0 +1,144 @@ 
+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 +326,18 @@
+ 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) $(EXTRA_DIST) $(noinst_DATA); do \
++		install -D $${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,13 @@
+ test_privserver_client_LDADD=../libdbus-testutils.la
+ test_autolaunch_LDADD=../libdbus-testutils.la
+ 
++install-ptest:
++	@$(MKDIR_P) $(DESTDIR)
++	@for file in Makefile $(noinst_PROGRAMS) $(EXTRA_DIST); do \
++		if [ -f .libs/$$file ]; then \
++			install .libs/$$file $(DESTDIR); \
++		else \
++			install $$file $(DESTDIR); \
++		fi \
++	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
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 0000000..e08ecb1
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-1.6.4/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+cd test
+make -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 0000000..5c08c93
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-1.6.4/test-run-path.patch
@@ -0,0 +1,26 @@ 
+
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+
+--- a/test/Makefile.am	2012-06-15 15:25:43.000000000 +0200
++++ b/test/Makefile.am	2012-11-16 09:24:44.263140840 +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
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 0000000..2982439
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-ptest_1.6.4.bb
@@ -0,0 +1,46 @@ 
+DESCRIPTION = "D-Bus test package, only used for D-bus functionality test."
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+                    file://dbus/dbus.h;firstline=6;endline=20;md5=6eea2e0c7750dd8e620dcb1437312fa5"
+
+DEPENDS = "python-pygobject dbus dbus-glib"
+
+RDEPENDS = "make"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+           file://tmpdir.patch \
+           file://ptest.patch \
+           file://dbus-1.init  \
+           file://run-ptest \
+           "
+
+SRC_URI[md5sum] = "5ec43dc4554cba638917317b2b4f7640"
+SRC_URI[sha256sum] = "5fba6b7a415d761a843fb8e0aee72db61cf13057a9ef8cdc795e5d369dc74cf1"
+
+S="${WORKDIR}/dbus-${PV}"
+FILESPATH = "${FILE_DIRNAME}/dbus-${PV}"
+
+inherit autotools pkgconfig gettext ptest
+
+EXTRA_OECONF_X = "${@base_contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
+EXTRA_OECONF_X_virtclass-native = "--without-x"
+
+EXTRA_OECONF = "--enable-tests \
+                --enable-modular-tests \
+                --enable-installed-tests \
+                --enable-checks \
+                --enable-asserts \
+                --enable-verbose-mode \
+                --disable-xml-docs \
+                --disable-doxygen-docs \
+                --disable-libaudit \
+                --with-xml=expat \
+                --with-systemdsystemunitdir=${systemd_unitdir}/system/ \
+                ${EXTRA_OECONF_X}"
+
+do_install() {
+    ptest_do_install
+    find ${D}${PTEST_PATH} -name Makefile | xargs sed -i 's/^Makefile:/_Makefile:/'
+}
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index d165cdd..112400f 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -9,6 +9,8 @@  X11DEPENDS = "virtual/libx11 libsm"
 DEPENDS = "expat virtual/libintl ${@base_contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)}"
 DEPENDS_class-native = "expat-native virtual/libintl-native"
 DEPENDS_class-nativesdk = "nativesdk-expat virtual/nativesdk-libintl virtual/libx11"
+RDEPENDS = "${@base_contains('DISTRO_FEATURES', 'ptest', 'dbus-ptest', '', d)}"
+RDEPENDS_class-native = ""
 
 INC_PR = "r5"