Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/5] ptest update
@ 2012-12-19 16:18 Björn Stenberg
  2012-12-19 16:18 ` [PATCH 1/5] Add a new distro feature "ptest" Björn Stenberg
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Björn Stenberg @ 2012-12-19 16:18 UTC (permalink / raw)
  To: openembedded-core

Here is an update of the ptest patch set.

The variables are now moved from bitbake.conf to a new ptest.bbclass, which
packages inherit to create a ptest package.

I have added patches for bash in this set, so it now includes ptest for
glib, dbus and bash. The do_install bits are also much cleaner now.

Björn Stenberg (5):
  Add a new distro feature "ptest".
  New package: ptest-runner
  Add ptest for glib.
  Add ptest for dbus.
  Add ptest for bash.

 meta/classes/image.bbclass                         |    6 +-
 meta/classes/packagegroup.bbclass                  |    2 +-
 meta/classes/ptest.bbclass                         |   34 +++++
 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 +
 .../glib-2.0/glib-2.0/Makefile-ptest.patch         |   61 ++++++++
 meta/recipes-core/glib-2.0/glib-2.0/run-ptest      |    3 +
 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb      |   25 +++-
 meta/recipes-core/glib-2.0/glib.inc                |    7 +-
 .../automake/automake/buildtest.patch              |   33 +++++
 meta/recipes-devtools/automake/automake_1.12.5.bb  |    3 +-
 .../bash/bash-4.2/build-tests.patch                |   48 +++++++
 meta/recipes-extended/bash/bash-4.2/run-ptest      |    2 +
 .../bash/bash-4.2/test-output.patch                |   25 ++++
 meta/recipes-extended/bash/bash.inc                |   16 ++-
 meta/recipes-extended/bash/bash_4.2.bb             |    3 +
 .../ptest-runner/files/ptest-runner                |   16 ++
 .../ptest-runner/ptest-runner_1.0.bb               |   17 +++
 21 files changed, 512 insertions(+), 10 deletions(-)
 create mode 100644 meta/classes/ptest.bbclass
 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
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/run-ptest
 create mode 100644 meta/recipes-devtools/automake/automake/buildtest.patch
 create mode 100644 meta/recipes-extended/bash/bash-4.2/build-tests.patch
 create mode 100644 meta/recipes-extended/bash/bash-4.2/run-ptest
 create mode 100644 meta/recipes-extended/bash/bash-4.2/test-output.patch
 create mode 100644 meta/recipes-support/ptest-runner/files/ptest-runner
 create mode 100644 meta/recipes-support/ptest-runner/ptest-runner_1.0.bb

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] Add a new distro feature "ptest".
  2012-12-19 16:18 [PATCH 0/5] ptest update Björn Stenberg
@ 2012-12-19 16:18 ` Björn Stenberg
  2012-12-19 16:18 ` [PATCH 2/5] New package: ptest-runner Björn Stenberg
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Björn Stenberg @ 2012-12-19 16:18 UTC (permalink / raw)
  To: openembedded-core

This patch creates a new distro feature "ptest", which creates -ptest
packages containing the test suite of the package for running on the
target. Test files are installed in /usr/lib/<pkg>/ptest.

The patch also includes a change to automake, splitting the "make check"
target into separate steps for building and running the tests.

Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 meta/classes/image.bbclass                         |    6 ++-
 meta/classes/packagegroup.bbclass                  |    2 +-
 meta/classes/ptest.bbclass                         |   34 ++++++++++++++++++++
 .../automake/automake/buildtest.patch              |   33 +++++++++++++++++++
 meta/recipes-devtools/automake/automake_1.12.5.bb  |    3 +-
 5 files changed, 74 insertions(+), 4 deletions(-)
 create mode 100644 meta/classes/ptest.bbclass
 create mode 100644 meta/recipes-devtools/automake/automake/buildtest.patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 719d871..9bc5d31 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -29,13 +29,13 @@ ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-manageme
 FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 
-# packages to install from features, excluding dev/dbg/doc
+# packages to install from features, excluding dev/dbg/doc/ptest
 NORMAL_FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(normal_groups(d), d))}"
 NORMAL_FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(normal_groups(d), d))}"
 
 def normal_groups(d):
     """Return all the IMAGE_FEATURES, with the exception of our special package groups"""
-    extras = set(['dev-pkgs', 'staticdev-pkgs', 'doc-pkgs', 'dbg-pkgs'])
+    extras = set(['dev-pkgs', 'staticdev-pkgs', 'doc-pkgs', 'dbg-pkgs', 'ptest-pkgs'])
     features = set(oe.data.typed_value('IMAGE_FEATURES', d))
     return features.difference(extras)
 
@@ -57,6 +57,8 @@ def complementary_globs(featurevar, d):
             globs.append('*-doc')
         elif feature == 'dbg-pkgs':
             globs.append('*-dbg')
+        elif feature == 'ptest-pkgs':
+            globs.append('*-ptest')
     return ' '.join(globs)
 
 IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'
diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
index fc67302..af6ee5d 100644
--- a/meta/classes/packagegroup.bbclass
+++ b/meta/classes/packagegroup.bbclass
@@ -25,7 +25,7 @@ python () {
     packages = d.getVar('PACKAGES', True).split()
     genpackages = []
     for pkg in packages:
-        for postfix in ['-dbg', '-dev']:
+        for postfix in ['-dbg', '-dev', '-ptest']:
             genpackages.append(pkg+postfix)
     d.setVar('PACKAGES', ' '.join(packages+genpackages))
 }
diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
new file mode 100644
index 0000000..8bde489
--- /dev/null
+++ b/meta/classes/ptest.bbclass
@@ -0,0 +1,34 @@
+# Ptest packages are built indirectly by a distro_feature,
+# no need for them to be a direct target of 'world'
+EXCLUDE_FROM_WORLD = "1"
+
+SUMMARY_${PN}-ptest ?= "${SUMMARY} - Package test files"
+DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION}  \
+This package contains a test directory ${PTEST_PATH} for package test purposes."
+
+PTEST_PATH ?= "${libdir}/${PN}/ptest"
+FILES_${PN}-ptest = "${PTEST_PATH}/*"
+SECTION_${PN}-ptest = "devel"
+ALLOW_EMPTY_${PN}-ptest = "1"
+PTEST_ENABLED = "${@base_contains("DISTRO_FEATURES", "ptest", "1", "0", d)}"
+RDEPENDS_${PN}-ptest_virtclass-native = ""
+RDEPENDS_${PN}-ptest_virtclass-nativesdk = ""
+
+PACKAGES += "${PN}-ptest"
+
+FILES_${PN}-dbg += "${PTEST_PATH}/*/.debug \
+                    ${PTEST_PATH}/*/*/.debug \
+                    ${PTEST_PATH}/*/*/*/.debug \
+                    ${PTEST_PATH}/*/*/*/*/.debug \
+                   "
+
+ptest_do_install() {
+    if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then
+        install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
+        if grep -q install-ptest: Makefile; then
+            oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
+        fi
+    fi
+}
+
+EXPORT_FUNCTIONS ptest_do_install
diff --git a/meta/recipes-devtools/automake/automake/buildtest.patch b/meta/recipes-devtools/automake/automake/buildtest.patch
new file mode 100644
index 0000000..1dd5337
--- /dev/null
+++ b/meta/recipes-devtools/automake/automake/buildtest.patch
@@ -0,0 +1,33 @@
+Split "check-TESTS" into a buildtest and runtest target, so that they can
+be run separately.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+
+--- a/lib/am/check.am	2012-11-14 13:46:16.335475995 +0100
++++ b/lib/am/check.am	2012-08-13 18:40:12.000000000 +0200
+@@ -44,7 +44,7 @@
+ am__tty_colors = $(am__tty_colors_dummy)
+ endif !%?COLOR%
+
+-.PHONY: check-TESTS
++.PHONY: check-TESTS buildtest-TESTS runtest-TESTS
+
+ if %?PARALLEL_TESTS%
+
+@@ -465,7 +465,14 @@
+
+ else !%?PARALLEL_TESTS%
+
+-check-TESTS: $(TESTS)
++AM_RECURSIVE_TARGETS += buildtest runtest
++
++buildtest-TESTS: $(TESTS)
++
++check-TESTS: buildtest-TESTS
++	$(MAKE) $(AM_MAKEFLAGS) runtest-TESTS
++
++runtest-TESTS:
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+ ## Make sure Solaris VPATH-expands all members of this list, even
diff --git a/meta/recipes-devtools/automake/automake_1.12.5.bb b/meta/recipes-devtools/automake/automake_1.12.5.bb
index 76e2b87..c681674 100644
--- a/meta/recipes-devtools/automake/automake_1.12.5.bb
+++ b/meta/recipes-devtools/automake/automake_1.12.5.bb
@@ -23,7 +23,8 @@ PATHFIXPATCH_class-nativesdk = ""
 SRC_URI += "${PATHFIXPATCH} \
 	    file://prefer-cpio-over-pax-for-ustar-archives.patch \
 	    file://python-libdir.patch \
-            file://py-compile-compile-only-optimized-byte-code.patch"
+            file://py-compile-compile-only-optimized-byte-code.patch \
+            file://buildtest.patch"
 
 SRC_URI[md5sum] = "674f6d28f8723e0f478cb03de30f36f1"
 SRC_URI[sha256sum] = "82089e23b384d3e64efa4f09f133a02dadb91c0593d4f1d4e12c29d806be9925"
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/5] New package: ptest-runner
  2012-12-19 16:18 [PATCH 0/5] ptest update Björn Stenberg
  2012-12-19 16:18 ` [PATCH 1/5] Add a new distro feature "ptest" Björn Stenberg
@ 2012-12-19 16:18 ` Björn Stenberg
  2012-12-19 16:18 ` [PATCH 3/5] Add ptest for glib Björn Stenberg
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Björn Stenberg @ 2012-12-19 16:18 UTC (permalink / raw)
  To: openembedded-core

This package contains a simple shell script which searches for all installed
ptests on the rootfs and runs each test in sequence.

Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 .../ptest-runner/files/ptest-runner                |   16 ++++++++++++++++
 .../ptest-runner/ptest-runner_1.0.bb               |   17 +++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-support/ptest-runner/files/ptest-runner
 create mode 100644 meta/recipes-support/ptest-runner/ptest-runner_1.0.bb

diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
new file mode 100644
index 0000000..4f3c7ce
--- /dev/null
+++ b/meta/recipes-support/ptest-runner/files/ptest-runner
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+echo "START: $0"
+cd /usr/lib
+for x in *
+do
+    if [ -x "/usr/lib/$x/ptest/run-ptest" ]; then
+       date "+%Y-%m-%dT%H:%M"
+        echo "BEGIN: $x"
+        cd /usr/lib/$x/ptest
+        ./run-ptest
+        echo "END: $x"
+       date "+%Y-%m-%dT%H:%M"
+    fi
+done
+echo "STOP: $0"
diff --git a/meta/recipes-support/ptest-runner/ptest-runner_1.0.bb b/meta/recipes-support/ptest-runner/ptest-runner_1.0.bb
new file mode 100644
index 0000000..6b866d4
--- /dev/null
+++ b/meta/recipes-support/ptest-runner/ptest-runner_1.0.bb
@@ -0,0 +1,17 @@
+SRC_URI += "file://ptest-runner"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_install () {
+    mkdir -p ${D}${bindir}
+    install -m 0755 ${WORKDIR}/ptest-runner ${D}${bindir}
+}
+
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_build[noexec] = "1"
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/5] Add ptest for glib.
  2012-12-19 16:18 [PATCH 0/5] ptest update Björn Stenberg
  2012-12-19 16:18 ` [PATCH 1/5] Add a new distro feature "ptest" Björn Stenberg
  2012-12-19 16:18 ` [PATCH 2/5] New package: ptest-runner Björn Stenberg
@ 2012-12-19 16:18 ` Björn Stenberg
  2012-12-19 16:18 ` [PATCH 4/5] Add ptest for dbus Björn Stenberg
  2012-12-19 16:18 ` [PATCH 5/5] Add ptest for bash Björn Stenberg
  4 siblings, 0 replies; 9+ messages in thread
From: Björn Stenberg @ 2012-12-19 16:18 UTC (permalink / raw)
  To: openembedded-core


Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 .../glib-2.0/glib-2.0/Makefile-ptest.patch         |   61 ++++++++++++++++++++
 meta/recipes-core/glib-2.0/glib-2.0/run-ptest      |    3 +
 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb      |   25 +++++++-
 meta/recipes-core/glib-2.0/glib.inc                |    7 +-
 4 files changed, 91 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/run-ptest

diff --git a/meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch b/meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch
new file mode 100644
index 0000000..cb36c09
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch
@@ -0,0 +1,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
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/run-ptest b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
new file mode 100644
index 0000000..3deb586
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -k ptest
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
index 966a851..9854585 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
@@ -12,6 +12,8 @@ SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]
 SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
            file://configure-libtool.patch \
            file://glib-2.0_fix_for_x32.patch \
+           file://Makefile-ptest.patch \
+           file://run-ptest \
           "
 SRC_URI[md5sum] = "a4ca31e258273c3761e3de2edd607661"
 SRC_URI[sha256sum] = "855fcbf87cb93065b488358e351774d8a39177281023bae58c286f41612658a7"
@@ -19,6 +21,24 @@ SRC_URI[sha256sum] = "855fcbf87cb93065b488358e351774d8a39177281023bae58c286f4161
 SRC_URI_append_class-native = " file://glib-gettextize-dir.patch"
 BBCLASSEXTEND = "native nativesdk"
 
+RDEPENDS_${PN}-ptest += "\
+            eglibc-gconv-utf-16 \
+            eglibc-charmap-utf-8 \
+            eglibc-gconv-cp1255 \
+            eglibc-charmap-cp1255 \
+            eglibc-gconv-utf-32 \
+            eglibc-gconv-utf-7 \
+            eglibc-charmap-invariant \
+            eglibc-localedata-translit-cjk-variants \
+            tzdata \
+            tzdata-americas \
+            tzdata-asia \
+            tzdata-europe \
+            tzdata-posix \
+            python-pygobject \
+            python-dbus \
+           "
+
 do_configure_prepend() {
 	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
 }
@@ -28,12 +48,13 @@ do_install_append() {
   rm -f ${D}${libdir}/gdbus-2.0/codegen/*.pyc
   rm -f ${D}${libdir}/gdbus-2.0/codegen/*.pyo
   # and empty dirs
-  rmdir ${D}${libdir}/gio/modules/
-  rmdir ${D}${libdir}/gio/
+  rm -rf ${D}${libdir}/gio
 
   # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
   # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
   if [ -f ${D}${bindir}/glib-mkenums ]; then
     sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums
   fi
+
+  ptest_do_install
 }
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
index bc831e6..53b20b6 100644
--- a/meta/recipes-core/glib-2.0/glib.inc
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -21,13 +21,14 @@ PACKAGES =+ "${PN}-utils ${PN}-bash-completion ${PN}-codegen"
 LEAD_SONAME = "libglib-2.0.*"
 FILES_${PN}-utils = "${bindir}/* ${datadir}/glib-2.0/gettext"
 
-inherit autotools gettext gtk-doc pkgconfig
+inherit autotools gettext gtk-doc pkgconfig ptest
 
 S = "${WORKDIR}/glib-${PV}"
 
-CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap --disable-modular-tests"
+CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap"
 
-EXTRA_OECONF = "--enable-included-printf=no ${CORECONF}"
+PTEST_CONF = "${@base_contains('DISTRO_FEATURES', 'ptest', '', '--disable-modular-tests', d)}"
+EXTRA_OECONF = "--enable-included-printf=no ${CORECONF} ${PTEST_CONF}"
 EXTRA_OECONF_class-native = "${CORECONF}"
 EXTRA_OECONF_linuxstdbase = "--enable-included-printf=no ${CORECONF}"
 
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/5] Add ptest for dbus.
  2012-12-19 16:18 [PATCH 0/5] ptest update Björn Stenberg
                   ` (2 preceding siblings ...)
  2012-12-19 16:18 ` [PATCH 3/5] Add ptest for glib Björn Stenberg
@ 2012-12-19 16:18 ` Björn Stenberg
  2012-12-19 17:38   ` Marcin Juszkiewicz
  2012-12-19 16:18 ` [PATCH 5/5] Add ptest for bash Björn Stenberg
  4 siblings, 1 reply; 9+ messages in thread
From: Björn Stenberg @ 2012-12-19 16:18 UTC (permalink / raw)
  To: openembedded-core

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

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"
 
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/5] Add ptest for bash.
  2012-12-19 16:18 [PATCH 0/5] ptest update Björn Stenberg
                   ` (3 preceding siblings ...)
  2012-12-19 16:18 ` [PATCH 4/5] Add ptest for dbus Björn Stenberg
@ 2012-12-19 16:18 ` Björn Stenberg
  4 siblings, 0 replies; 9+ messages in thread
From: Björn Stenberg @ 2012-12-19 16:18 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 .../bash/bash-4.2/build-tests.patch                |   48 ++++++++++++++++++++
 meta/recipes-extended/bash/bash-4.2/run-ptest      |    2 +
 .../bash/bash-4.2/test-output.patch                |   25 ++++++++++
 meta/recipes-extended/bash/bash.inc                |   16 ++++++-
 meta/recipes-extended/bash/bash_4.2.bb             |    3 +
 5 files changed, 93 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-extended/bash/bash-4.2/build-tests.patch
 create mode 100644 meta/recipes-extended/bash/bash-4.2/run-ptest
 create mode 100644 meta/recipes-extended/bash/bash-4.2/test-output.patch

diff --git a/meta/recipes-extended/bash/bash-4.2/build-tests.patch b/meta/recipes-extended/bash/bash-4.2/build-tests.patch
new file mode 100644
index 0000000..0360881
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-4.2/build-tests.patch
@@ -0,0 +1,48 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/Makefile.in b/Makefile.in
+--- a/Makefile.in	2012-11-06 08:40:07.552403063 +0100
++++ b/Makefile.in	2012-11-06 11:13:36.958297555 +0100
+@@ -827,20 +827,34 @@
+ 	fi
+ 
+ recho$(EXEEXT):		$(SUPPORT_SRC)recho.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) -o $@ $<
+ 
+ zecho$(EXEEXT):		$(SUPPORT_SRC)zecho.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) -o $@ $<
+ 
+ printenv$(EXEEXT):	$(SUPPORT_SRC)printenv.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) -o $@ $<
+ 
+ xcase$(EXEEXT):	$(SUPPORT_SRC)xcase.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) -o $@ $<
+ 
+-test tests check:	force $(Program) $(TESTS_SUPPORT)
++test tests check:
++	@$(MAKE) install-test
++	@$(MAKE) runtest
++
++install-test: buildtest
++ifeq ($(origin INSTALL_TEST_DIR), undefined)
+ 	@-test -d tests || mkdir tests
+ 	@cp $(TESTS_SUPPORT) tests
++else
++	@-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
++	@cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
++	@cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
++endif
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
++
++runtest:
+ 	@( cd $(srcdir)/tests && \
+ 		PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
+ 
diff --git a/meta/recipes-extended/bash/bash-4.2/run-ptest b/meta/recipes-extended/bash/bash-4.2/run-ptest
new file mode 100644
index 0000000..66f1eee
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-4.2/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo Makefile: | make -f Makefile -f - -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/meta/recipes-extended/bash/bash-4.2/test-output.patch b/meta/recipes-extended/bash/bash-4.2/test-output.patch
new file mode 100644
index 0000000..7d0ce63
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-4.2/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all	1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all	2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ 	case $x in
+ 	$0|run-minimal|run-gprof)	;;
+ 	*.orig|*~) ;;
+-	*)	echo $x ; sh $x ;;
++    *)  echo $x
++         output=`sh $x`
++         if [ -n "$output" ]; then
++             echo "$output"
++             echo "FAIL: $x"
++         else
++             echo "PASS: $x"
++         fi
++         ;;
+ 	esac
+ done
+ 
diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index f1de931..20a23f0 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -4,7 +4,7 @@ SECTION = "base/shell"
 
 DEPENDS = "ncurses bison-native"
 
-inherit autotools gettext update-alternatives
+inherit autotools gettext update-alternatives ptest
 
 PARALLEL_MAKE = ""
 
@@ -17,18 +17,32 @@ ALTERNATIVE_PRIORITY = "100"
 
 export AUTOHEADER = "true"
 
+RDEPENDS_${PN}-ptest += "make"
+
 do_configure_prepend () {
 	if [ ! -e acinclude.m4 ]; then
 		cat aclocal.m4 > acinclude.m4
 	fi
 }
 
+do_compile_append () {
+        if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then
+            oe_runmake buildtest
+        fi
+}
+
 do_install_append () {
 	# Move /usr/bin/bash to /bin/bash, if need
 	if [ "${base_bindir}" != "${bindir}" ]; then
 		mkdir -p ${D}${base_bindir}
 		mv ${D}${bindir}/bash ${D}${base_bindir}
 	fi
+
+        if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then
+            ptest_do_install
+            make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
+            cp ${B}/Makefile ${D}${PTEST_PATH}
+        fi
 }
 
 pkg_postinst_${PN} () {
diff --git a/meta/recipes-extended/bash/bash_4.2.bb b/meta/recipes-extended/bash/bash_4.2.bb
index 07dda09..fefe7b7 100644
--- a/meta/recipes-extended/bash/bash_4.2.bb
+++ b/meta/recipes-extended/bash/bash_4.2.bb
@@ -19,6 +19,9 @@ SRC_URI = "${GNU_MIRROR}/bash/${BPN}-${PV}.tar.gz;name=tarball \
            ${GNU_MIRROR}/bash/bash-4.2-patches/bash42-010;apply=yes;striplevel=0;name=patch010 \
            file://execute_cmd.patch;striplevel=0 \
            file://mkbuiltins_have_stringize.patch \
+           file://build-tests.patch \
+           file://test-output.patch \
+           file://run-ptest \
            "
 
 SRC_URI[tarball.md5sum] = "3fb927c7c33022f1c327f14a81c0d4b0"
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/5] Add ptest for dbus.
  2012-12-19 16:18 ` [PATCH 4/5] Add ptest for dbus Björn Stenberg
@ 2012-12-19 17:38   ` Marcin Juszkiewicz
  2012-12-20 13:53     ` Björn Stenberg
  2012-12-20 14:32     ` Björn Stenberg
  0 siblings, 2 replies; 9+ messages in thread
From: Marcin Juszkiewicz @ 2012-12-19 17:38 UTC (permalink / raw)
  To: openembedded-core

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.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/5] Add ptest for dbus.
  2012-12-19 17:38   ` Marcin Juszkiewicz
@ 2012-12-20 13:53     ` Björn Stenberg
  2012-12-20 14:32     ` Björn Stenberg
  1 sibling, 0 replies; 9+ messages in thread
From: Björn Stenberg @ 2012-12-20 13:53 UTC (permalink / raw)
  To: openembedded-core

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

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..68f5e40 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_dbus = "${@base_contains('DISTRO_FEATURES', 'ptest', 'dbus-ptest', '', d)}"
+RDEPENDS_class-native = ""
 
 INC_PR = "r5"
 
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/5] Add ptest for dbus.
  2012-12-19 17:38   ` Marcin Juszkiewicz
  2012-12-20 13:53     ` Björn Stenberg
@ 2012-12-20 14:32     ` Björn Stenberg
  1 sibling, 0 replies; 9+ messages in thread
From: Björn Stenberg @ 2012-12-20 14:32 UTC (permalink / raw)
  To: Marcin Juszkiewicz; +Cc: openembedded-core

Marcin Juszkiewicz wrote:
> ExpansionError: Failure expanding variable RDEPENDS_dbus-lib

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

-- 
Björn



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-12-20 14:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-19 16:18 [PATCH 0/5] ptest update Björn Stenberg
2012-12-19 16:18 ` [PATCH 1/5] Add a new distro feature "ptest" Björn Stenberg
2012-12-19 16:18 ` [PATCH 2/5] New package: ptest-runner Björn Stenberg
2012-12-19 16:18 ` [PATCH 3/5] Add ptest for glib Björn Stenberg
2012-12-19 16:18 ` [PATCH 4/5] Add ptest for dbus Björn Stenberg
2012-12-19 17:38   ` Marcin Juszkiewicz
2012-12-20 13:53     ` Björn Stenberg
2012-12-20 14:32     ` Björn Stenberg
2012-12-19 16:18 ` [PATCH 5/5] Add ptest for bash Björn Stenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox