ptest for master
cover ptest for master
Hi all.
[Repeating the description here for completeness.]
Here is an update of the "ptest" concept I introduced a few months back. The idea is to create a new package group called -ptest which contains the test suites included with many source packages, compiled to run on target.
A new package, ptest-runnner, contains a simple shell script to find and run all installed ptests.
Making ptest package recipes present a number of challenges. First, the task of building and running the tests have to be split in two. Then, the test files must be installed in the file system in a sane way.
I have included recipe patches for glib-2.0 and dbus here. They solve the building and running relatively cleanly but the install bit is still a rather kludgy list of cp and sed lines. I'm working on a more generic "make ptest-install" solution.
These patches are against the "master" branch.
Björn Stenberg (4):
Add a new distro feature "ptest".
New package: ptest-runner
Add ptest package for glib-2.0.
Add ptest for dbus.
meta/classes/image.bbclass | 6 +- meta/classes/packagegroup.bbclass | 2 +- meta/conf/bitbake.conf | 15 +++- 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 + .../glib-2.0/glib-2.0/Makefile-ptest.patch | 30 +++++++ meta/recipes-core/glib-2.0/glib-2.0/run-ptest | 3 + meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb | 57 +++++++++++++ meta/recipes-core/glib-2.0/glib.inc | 5 +- .../automake/automake/buildtest.patch | 33 ++++++++ meta/recipes-devtools/automake/automake_1.12.3.bb | 3 +- .../ptest-runner/files/ptest-runner | 16 ++++ .../ptest-runner/ptest-runner_1.0.bb | 17 ++++ 15 files changed, 296 insertions(+), 7 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 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-support/ptest-runner/files/ptest-runner create mode 100644 meta/recipes-support/ptest-runner/ptest-runner_1.0.bb
Signature · 1 line
1.7.5.4
PATCH 1/4 Add a new distro feature "ptest".
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.
--- meta/classes/image.bbclass | 6 ++- meta/classes/packagegroup.bbclass | 2 +- meta/conf/bitbake.conf | 15 ++++++++- .../automake/automake/buildtest.patch | 33 ++++++++++++++++++++ meta/recipes-devtools/automake/automake_1.12.3.bb | 3 +- 5 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 meta/recipes-devtools/automake/automake/buildtest.patch
meta/classes/image.bbclass +4 -2
@@ -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)}'
meta/classes/packagegroup.bbclass +1 -1
@@ -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)) }
meta/conf/bitbake.conf +14 -1
@@ -224,6 +224,10 @@ SUMMARY_${PN}-dbg ?= "${SUMMARY} - Debugging files" DESCRIPTION_${PN}-dbg ?= "${DESCRIPTION} \ This package contains ELF symbols and related sources for debugging purposes." +SUMMARY_${PN}-ptest ?= "${SUMMARY} - Package test files" +DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION} \ +This package contains a test directory ${PTEST_PATH} for package test purposes." + SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files" DESCRIPTION_${PN}-dev ?= "${DESCRIPTION} \ This package contains symbolic links, header files, and \
@@ -267,7 +271,7 @@ SOLIBSDEV_darwin8 = ".dylib" SOLIBSDEV_darwin9 = ".dylib" PACKAGE_BEFORE_PN ?= "" -PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}" +PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PN}-ptest ${PACKAGE_BEFORE_PN} ${PN}" PACKAGES_DYNAMIC = "^${PN}-locale-.*" FILES = ""
@@ -312,6 +316,15 @@ SECTION_${PN}-dbg = "devel" ALLOW_EMPTY_${PN}-dbg = "1" RRECOMMENDS_${PN}-dbg = "${PN} (= ${EXTENDPKGV})" +PTEST_PATH ?= "${libdir}/${PN}/ptest" +FILES_${PN}-ptest = "${PTEST_PATH}/*" +SECTION_${PN}-ptest = "devel" +ALLOW_EMPTY_${PN}-ptest = "1" +RDEPENDS_${PN}-ptest = "${PN} (= ${EXTENDPKGV})" +PTEST_ENABLED = "${@base_contains("DISTRO_FEATURES", "ptest", "1", "0", d)}" +RDEPENDS_${PN}-ptest_virtclass-native = "" +RDEPENDS_${PN}-ptest_virtclass-nativesdk = "" + FILES_${PN}-locale = "${datadir}/locale" # File manifest
meta/recipes-devtools/automake/automake/buildtest.patch new file +33 -0
@@ -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 <[email protected]> +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
meta/recipes-devtools/automake/automake_1.12.3.bb +2 -1
@@ -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] = "d2af8484de94cdee16d89c50aaa1c729" SRC_URI[sha256sum] = "095ffaa3ac887d1eb3511bf13d7f1fc9ec0503c6a06aeae05c93730cdda9a5a0"
Signature · 1 line
1.7.5.4
Re: [PATCH 1/4] Add a new distro feature "ptest".
Quoted 89 lines · Björn Stenberg
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 <[email protected]>--- meta/classes/image.bbclass | 6 ++- meta/classes/packagegroup.bbclass | 2 +- meta/conf/bitbake.conf | 15 ++++++++- .../automake/automake/buildtest.patch | 33 ++++++++++++++++++++ meta/recipes-devtools/automake/automake_1.12.3.bb | 3 +- 5 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 meta/recipes-devtools/automake/automake/buildtest.patchmeta/classes/image.bbclass +4
-2@@ -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)}'meta/classes/packagegroup.bbclass +1
-1@@ -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)) }meta/conf/bitbake.conf +7
-1@@ -224,6 +224,10 @@ SUMMARY_${PN}-dbg ?= "${SUMMARY} - Debugging files" DESCRIPTION_${PN}-dbg ?= "${DESCRIPTION} \ This package contains ELF symbols and related sources for debugging purposes." +SUMMARY_${PN}-ptest ?= "${SUMMARY} - Package test files" +DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION} \ +This package contains a test directory ${PTEST_PATH} for package test purposes." + SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files" DESCRIPTION_${PN}-dev ?= "${DESCRIPTION} \ This package contains symbolic links, header files, and \@@ -267,7 +271,7 @@ SOLIBSDEV_darwin8 = ".dylib" SOLIBSDEV_darwin9 = ".dylib" PACKAGE_BEFORE_PN ?= "" -PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}" +PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PN}-ptest ${PACKAGE_BEFORE_PN} ${PN}" PACKAGES_DYNAMIC = "^${PN}-locale-.*" FILES = ""@@ -312,6 +316,15 @@ SECTION_${PN}-dbg = "devel" ALLOW_EMPTY_${PN}-dbg = "1" RRECOMMENDS_${PN}-dbg = "${PN} (= ${EXTENDPKGV})" +PTEST_PATH ?= "${libdir}/${PN}/ptest" +FILES_${PN}-ptest = "${PTEST_PATH}/*"
meta/conf/bitbake.conf SECTION_${PN}-dbg = "devel" · line 330
Quoted 10 lines
meta/conf/bitbake.conf +7
-0+SECTION_${PN}-ptest = "devel" +ALLOW_EMPTY_${PN}-ptest = "1" +RDEPENDS_${PN}-ptest = "${PN} (= ${EXTENDPKGV})" +PTEST_ENABLED = "${@base_contains("DISTRO_FEATURES", "ptest", "1", "0", d)}" +RDEPENDS_${PN}-ptest_virtclass-native = "" +RDEPENDS_${PN}-ptest_virtclass-nativesdk = "" + FILES_${PN}-locale = "${datadir}/locale" # File manifest
Whilst we're in bootstrapping mode for this work, how about we make these changes a "ptest.bbclass" file which we'd inherit in the recipes where we've got ptest enabled?
This would also solve the package name conflict I suspect you have in the dbus recipes, making the hack to the main dbus recipe unnecessary.
Cheers,
Richard
Re: [PATCH 1/4] Add a new distro feature "ptest".
Quoted 3 lines · Richard Purdie
Whilst we're in bootstrapping mode for this work, how about we make these changes a "ptest.bbclass" file which we'd inherit in the recipes where we've got ptest enabled?
Ok. I'll give it a go and see how it turns out.
Signature · 1 line
Björn
Re: [PATCH 1/4] Add a new distro feature "ptest".
In reply to Richard PurdieQuoted 7 lines · Richard Purdie
Quoted 3 lines
meta/classes/image.bbclass | 6 ++- meta/classes/packagegroup.bbclass | 2 +- meta/conf/bitbake.conf | 15 ++++++++-Whilst we're in bootstrapping mode for this work, how about we make these changes a "ptest.bbclass" file which we'd inherit in the recipes where we've got ptest enabled?
Having looked into it a bit, I'm not sure I understand how you mean.
First, I don't quite see how this would be done in an elegant way for the in-function changes in image.bbclass and packagegroup.bbclass.
And the lines added to bitbake.conf were put there because they mirror other complementary packages like -dbg and -dev. Is it really a good idea to invent a new way of doing this for -ptest packages?
Signature · 1 line
Björn
Re: [PATCH 1/4] Add a new distro feature "ptest".
Quoted 5 lines · Björn Stenberg
Quoted 4 lines · Richard Purdie
Quoted 3 lines
meta/classes/image.bbclass | 6 ++- meta/classes/packagegroup.bbclass | 2 +- meta/conf/bitbake.conf | 15 ++++++++-
Quoted 8 lines
Quoted 3 lines
Whilst we're in bootstrapping mode for this work, how about we make these changes a "ptest.bbclass" file which we'd inherit in the recipes where we've got ptest enabled?
Having looked into it a bit, I'm not sure I understand how you mean.
First, I don't quite see how this would be done in an elegant way for the in-function changes in image.bbclass and packagegroup.bbclass.
Those are pretty non-invasive so I think we can just add these pieces in directly as you have them now.
Quoted 3 lines
And the lines added to bitbake.conf were put there because they mirror other complementary packages like -dbg and -dev. Is it really a good idea to invent a new way of doing this for -ptest packages?
This isn't a "new way". We can easily put these in a .bbclass for now. Pretty much every package has a -dev and -dbg package but for now, the number of packages which will have ptest is limited. Its a waste of build time having the -ptest metadata being processed for every package, its also confusing.
So I think my proposal stands, lets put the pieces from bitbake.conf into a bbclass file for now, the other pieces can merge into the core code. As and when we have more than say 60% of the metadata with ptest we can think about making -ptest packages the default.
Cheers,
Richard
Quoted 1 line
Re: [PATCH 1/4] Add a new distro feature "ptest".
Quoted 3 lines · Richard Purdie
So I think my proposal stands, lets put the pieces from bitbake.conf into a bbclass file for now, the other pieces can merge into the core code.
Fair enough. I'll get a new patch set together.
Signature · 1 line
Björn
PATCH 2/4 New package: ptest-runner
In reply to Björn StenbergThis package contains a simple shell script which searches for all installed ptests on the rootfs and runs each test in sequence.
--- .../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
meta/recipes-support/ptest-runner/files/ptest-runner new file +16 -0
@@ -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"
meta/recipes-support/ptest-runner/ptest-runner_1.0.bb new file +17 -0
@@ -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"
Signature · 1 line
1.7.5.4
PATCH 3/4 Add ptest for glib.
In reply to Björn Stenberg--- .../glib-2.0/glib-2.0/Makefile-ptest.patch | 30 ++++++++++ meta/recipes-core/glib-2.0/glib-2.0/run-ptest | 3 + meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb | 57 ++++++++++++++++++++ meta/recipes-core/glib-2.0/glib.inc | 5 +- 4 files changed, 93 insertions(+), 2 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
meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch new file +30 -0
@@ -0,0 +1,30 @@ +Add 'ptest' target to Makefile, to run tests without checking dependencies. + +Signed-off-by: Björn Stenberg <[email protected]> +Upstream-status: Pending +--- + Makefile.decl | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/Makefile.decl 2012-03-12 01:42:39.000000000 +0100 ++++ b/Makefile.decl 2012-11-12 17:02:36.838107381 +0100 +@@ -25,6 +25,19 @@ + test-nonrecursive: + endif + ++ptest: ptest-nonrecursive ++if OS_UNIX ++ @ 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} ++else ++ptest-nonrecursive: ++endif ++ + # 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
meta/recipes-core/glib-2.0/glib-2.0/run-ptest new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh + +make -k ptest
meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb +57 -0
73 lines not on this page · raw message
meta/recipes-core/glib-2.0/glib.inc +3 -2
@@ -25,9 +25,10 @@ inherit autotools gettext gtk-doc pkgconfig 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} ${TEST_CONF}" EXTRA_OECONF_class-native = "${CORECONF}" EXTRA_OECONF_linuxstdbase = "--enable-included-printf=no ${CORECONF}"
Signature · 1 line
1.7.5.4
Re: [PATCH 3/4] Add ptest for glib.
Quoted 6 lines · Björn Stenberg
meta/recipes-core/glib-2.0/glib.inc +0
-0@@ -25,9 +25,10 @@ inherit autotools gettext gtk-doc pkgconfig
meta/recipes-core/glib-2.0/glib.inc inherit autotools gettext gtk-doc pkgconfig · line 33
Quoted 10 lines
meta/recipes-core/glib-2.0/glib.inc +3
-2S = "${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} ${TEST_CONF}" EXTRA_OECONF_class-native = "${CORECONF}" EXTRA_OECONF_linuxstdbase = "--enable-included-printf=no ${CORECONF}"
The changes to the recipe to install the tests are certainly ugly. I know you're working on that. Above, there is a typo, TEST_CONF instead of PTEST_CONF.
Cheers,
Richard
PATCH 3/4 Add ptest for glib.
In reply to Björn StenbergMoved install logic from recipe to makefiles.
--- .../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.1.bb | 40 +++++++++++++ meta/recipes-core/glib-2.0/glib.inc | 5 +- 4 files changed, 107 insertions(+), 2 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
meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch new file +61 -0
@@ -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 <[email protected]> +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) PTESTDIR=$(PTESTDIR)/$$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 $(PTESTDIR) ++ @if [ -n "${TEST_PROGS}" ]; then \ ++ if [ -n "${EXTRA_DIST}" ]; then \ ++ cp ${EXTRA_DIST} $(PTESTDIR); \ ++ fi; \ ++ grep -q dist-hook: Makefile && \ ++ $(MAKE) distdir=$(PTESTDIR) dist-hook; \ ++ if [ -d .libs ] ; then \ ++ cd .libs; \ ++ fi; \ ++ cp ${TEST_PROGS} $(PTESTDIR); \ ++ fi; ++ @if [ -n "${INSTALL_PROGS}" ]; then \ ++ if [ -d .libs ] ; then \ ++ cd .libs; \ ++ fi; \ ++ cp ${INSTALL_PROGS} $(PTESTDIR); \ ++ fi ++ @test -f Makefile && sed 's/^Makefile:/_Makefile:/' <Makefile >$(PTESTDIR)/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
meta/recipes-core/glib-2.0/glib-2.0/run-ptest new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh + +make -k ptest
meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb +40 -0
@@ -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] = "ee779493b083be9348a841e0a51f1b27" SRC_URI[sha256sum] = "6e84dc9d84b104725b34d255421ed7ac3629e49f437d37addde5ce3891c2e2f1"
@@ -19,6 +21,38 @@ SRC_URI[sha256sum] = "6e84dc9d84b104725b34d255421ed7ac3629e49f437d37addde5ce3891 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 \ + " + +FILES_${PN}-dbg += "${PTEST_PATH}/gio/.libs/.debug \ + ${PTEST_PATH}/gio/tests/.debug \ + ${PTEST_PATH}/gio/tests/.libs/.debug \ + ${PTEST_PATH}/glib/.debug \ + ${PTEST_PATH}/glib/.libs/.debug \ + ${PTEST_PATH}/glib/tests/.debug \ + ${PTEST_PATH}/glib/tests/.libs/.debug \ + ${PTEST_PATH}/gobject/.libs/.debug \ + ${PTEST_PATH}/gobject/tests/.debug \ + ${PTEST_PATH}/gobject/tests/.libs/.debug \ + ${PTEST_PATH}/tests/.debug \ + ${PTEST_PATH}/tests/.libs/.debug \ + ${PTEST_PATH}/tests/refcount/.libs/.debug" + do_configure_prepend() { sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in }
@@ -36,4 +70,10 @@ do_install_append() { if [ -f ${D}${bindir}/glib-mkenums ]; then sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums fi + + if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then + mkdir -p ${D}${PTEST_PATH} + install -m 0755 ${WORKDIR}/run-ptest ${D}${PTEST_PATH} + make PTESTDIR=${D}${PTEST_PATH} install-ptest + fi }
meta/recipes-core/glib-2.0/glib.inc +3 -2
@@ -25,9 +25,10 @@ inherit autotools gettext gtk-doc pkgconfig 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}"
Signature · 1 line
1.7.5.4
PATCH 4/4 Add ptest for dbus.
In reply to Björn StenbergThis 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.
--- 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
meta/recipes-core/dbus/dbus-1.6.4/run-ptest new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh +cd test +make -k runtest-TESTS
meta/recipes-core/dbus/dbus-1.6.4/test-run-path.patch new file +26 -0
@@ -0,0 +1,26 @@ + + +Signed-off-by: Björn Stenberg <[email protected]> +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
meta/recipes-core/dbus/dbus-test_1.6.4.bb new file +84 -0
84 lines not on this page · raw message
meta/recipes-core/dbus/dbus.inc +3 -0
@@ -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"
Signature · 1 line
1.7.5.4
Re: [PATCH 4/4] Add ptest for dbus.
Quoted 9 lines · Björn Stenberg
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 <[email protected]>
...
meta/recipes-core/dbus/dbus.inc X11DEPENDS = "virtual/libx11 libsm" · line 13
Quoted 6 lines
meta/recipes-core/dbus/dbus.inc +2
-0@@ -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 = ""
Maybe this could be handled in the native.bbclass?
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Re: [PATCH 4/4] Add ptest for dbus.
In reply to Björn StenbergQuoted 7 lines · Björn Stenberg
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.
Why not call the recipe dbus-ptest, then the standard logic would work?
Cheers,
Richard