Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Björn Stenberg" <bjst@enea.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 4/4] Add ptest for dbus.
Date: Thu, 22 Nov 2012 17:02:00 +0100	[thread overview]
Message-ID: <1353600120-22967-5-git-send-email-bjst@enea.com> (raw)
In-Reply-To: <1353600120-22967-1-git-send-email-bjst@enea.com>

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.

An RDEPENDS rule is added to the dbus recipe to include the dbus-test
package into the image when ptest is enabled, since the standard -ptest
suffix mechanism does not apply to this package.

Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 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-test_1.6.4.bb          |   84 ++++++++++++++++++++
 meta/recipes-core/dbus/dbus.inc                    |    3 +
 4 files changed, 116 insertions(+), 0 deletions(-)
 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-test_1.6.4.bb

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-test_1.6.4.bb b/meta/recipes-core/dbus/dbus-test_1.6.4.bb
new file mode 100644
index 0000000..84829f7
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-test_1.6.4.bb
@@ -0,0 +1,84 @@
+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"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+           file://tmpdir.patch \
+           file://test-run-path.patch \
+           file://dbus-1.init  \
+           file://run-ptest \
+           "
+
+S="${WORKDIR}/dbus-${PV}"
+FILESPATH = "${FILE_DIRNAME}/dbus-${PV}"
+
+inherit autotools pkgconfig gettext
+
+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-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}"
+
+FILES_${PN}-dbg = "\
+                   ${PTEST_PATH}/test/name-test/.debug \
+                   ${PTEST_PATH}/test/.debug \
+                   ${PTEST_PATH}/test/.libs/.debug \
+                   ${PTEST_PATH}/.debug \
+                   ${PTEST_PATH}/bus/.debug \
+                   ${PTEST_PATH}/dbus/.debug \
+                   ${PTEST_PATH}/tools/.debug \
+                   ${PTEST_PATH}/tools/.libs/.debug \
+                   /usr/src \
+                   /usr/src/debug \
+                   /usr/src/debug/${PN}-${PV}/dbus-${PV}/test/name-test/.debug \
+                   /usr/src/debug/${PN}-${PV}/dbus-${PV}/test/.debug \
+                   /usr/src/debug/${PN}-${PV}/dbus-${PV}/test/.libs/.debug \
+                   /usr/src/debug/${PN}-${PV}/dbus-${PV}/.debug \
+                   /usr/src/debug/${PN}-${PV}/dbus-${PV}/bus/.debug \
+                   /usr/src/debug/${PN}-${PV}/dbus-${PV}/tools/.debug \
+                   /usr/src/debug/${PN}-${PV}/dbus-${PV}/tools/.libs/.debug \
+                  "
+
+FILES_${PN}-staticdev = "${PTEST_PATH}/test/.libs \
+                         ${PTEST_PATH}/tools/.libs \
+                        "
+do_install() {
+    mkdir -p ${D}${libdir}/${PN}
+    touch ${D}${libdir}/${PN}/empty_file
+
+    if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ] ; then
+        mkdir -p ${D}${PTEST_PATH}
+        install -m 0755 ${WORKDIR}/run-ptest ${D}${PTEST_PATH}
+        cp ${S}/Makefile ${D}${PTEST_PATH}
+
+        for subdir in dbus bus tools test doc; do
+            mkdir -p ${D}${PTEST_PATH}/$subdir
+        done
+
+        cp ${S}/bus/bus-test*   ${D}${PTEST_PATH}/bus
+        cp ${S}/bus/dbus-daemon ${D}${PTEST_PATH}/bus
+        cp ${S}/dbus/dbus-test  ${D}${PTEST_PATH}/dbus
+        cp ${S}/tools/.libs/*   ${D}${PTEST_PATH}/tools
+
+        cp -r ${S}/test         ${D}${PTEST_PATH}
+        find ${D}${PTEST_PATH}/test -name "*.[choa]" -o -name "*.la" | xargs rm
+        mv -f ${D}${PTEST_PATH}/test/.libs/* ${D}${PTEST_PATH}/test
+        rm -rf ${D}${PTEST_PATH}/test/.libs
+
+        find ${D}${PTEST_PATH} -name Makefile | xargs sed -i 's/^Makefile:/_Makefile:/'
+    fi
+}
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index d165cdd..ab7d9f6 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -9,6 +9,9 @@ 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-test', '', d)}"
+RDEPENDS_class-native = ""
+
 
 INC_PR = "r5"
 
-- 
1.7.5.4




  parent reply	other threads:[~2012-11-22 16:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22 16:01 [PATCH 0/4] ptest for master Björn Stenberg
2012-11-22 16:01 ` [PATCH 1/4] Add a new distro feature "ptest" Björn Stenberg
2012-11-23 21:49   ` Richard Purdie
2012-11-28 14:44     ` Björn Stenberg
2012-11-29 15:52     ` Björn Stenberg
2012-12-04 16:49       ` Richard Purdie
2012-12-05 10:17         ` Björn Stenberg
2012-11-22 16:01 ` [PATCH 2/4] New package: ptest-runner Björn Stenberg
2012-11-22 16:01 ` [PATCH 3/4] Add ptest for glib Björn Stenberg
2012-11-23 21:50   ` Richard Purdie
2012-11-28 13:32   ` Björn Stenberg
2012-11-22 16:02 ` Björn Stenberg [this message]
2012-11-22 16:06   ` [PATCH 4/4] Add ptest for dbus Otavio Salvador
2012-11-23 21:46   ` Richard Purdie
  -- strict thread matches above, loose matches on Subject: below --
2012-11-21 15:23 [PATCH 0/4] RFC: ptest for danny Björn Stenberg
2012-11-21 15:23 ` [PATCH 4/4] Add ptest for dbus Björn Stenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353600120-22967-5-git-send-email-bjst@enea.com \
    --to=bjst@enea.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox