* [PATCH 1/4] Add a new distro feature "ptest"
2012-11-21 15:23 [PATCH 0/4] RFC: ptest for danny Björn Stenberg
@ 2012-11-21 15:23 ` Björn Stenberg
0 siblings, 0 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-11-21 15:23 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/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
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ab212b3..94182d1 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 e0e5b1c..b5be048 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/conf/bitbake.conf b/meta/conf/bitbake.conf
index 5cb5b13..783ca37 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -223,6 +223,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 test directory with the name ${PTEST_NAME} for package test purposes."
+
SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files"
DESCRIPTION_${PN}-dev ?= "${DESCRIPTION} \
This package contains symbolic links, header files, and \
@@ -266,7 +270,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 = ""
@@ -310,6 +314,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
diff --git a/meta/recipes-devtools/automake/automake/buildtest.patch b/meta/recipes-devtools/automake/automake/buildtest.patch
new file mode 100644
index 0000000..7efff6b
--- /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.3.bb b/meta/recipes-devtools/automake/automake_1.12.3.bb
index af99dfa..40169d3 100644
--- a/meta/recipes-devtools/automake/automake_1.12.3.bb
+++ b/meta/recipes-devtools/automake/automake_1.12.3.bb
@@ -37,7 +37,8 @@ PATHFIXPATCH_virtclass-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"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 0/4] ptest for master
@ 2012-11-22 16:01 Björn Stenberg
2012-11-22 16:01 ` [PATCH 1/4] Add a new distro feature "ptest" Björn Stenberg
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-11-22 16:01 UTC (permalink / raw)
To: openembedded-core
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
--
1.7.5.4
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/4] Add a new distro feature "ptest".
2012-11-22 16:01 [PATCH 0/4] ptest for master Björn Stenberg
@ 2012-11-22 16:01 ` Björn Stenberg
2012-11-23 21:49 ` Richard Purdie
2012-11-22 16:01 ` [PATCH 2/4] New package: ptest-runner Björn Stenberg
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Björn Stenberg @ 2012-11-22 16:01 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/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
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 7b24e4e..b574545 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 e0e5b1c..b5be048 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/conf/bitbake.conf b/meta/conf/bitbake.conf
index 450a0ee..d86e999 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -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
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.3.bb b/meta/recipes-devtools/automake/automake_1.12.3.bb
index aaa5ee5..82b8b62 100644
--- a/meta/recipes-devtools/automake/automake_1.12.3.bb
+++ b/meta/recipes-devtools/automake/automake_1.12.3.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] = "d2af8484de94cdee16d89c50aaa1c729"
SRC_URI[sha256sum] = "095ffaa3ac887d1eb3511bf13d7f1fc9ec0503c6a06aeae05c93730cdda9a5a0"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/4] New package: ptest-runner
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-22 16:01 ` Björn Stenberg
2012-11-22 16:01 ` [PATCH 3/4] Add ptest for glib Björn Stenberg
2012-11-22 16:02 ` [PATCH 4/4] Add ptest for dbus Björn Stenberg
3 siblings, 0 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-11-22 16:01 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] 15+ messages in thread
* [PATCH 3/4] Add ptest for glib.
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-22 16:01 ` [PATCH 2/4] New package: ptest-runner Björn Stenberg
@ 2012-11-22 16:01 ` Björn Stenberg
2012-11-23 21:50 ` Richard Purdie
2012-11-28 13:32 ` Björn Stenberg
2012-11-22 16:02 ` [PATCH 4/4] Add ptest for dbus Björn Stenberg
3 siblings, 2 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-11-22 16:01 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Björn Stenberg <bjst@enea.com>
---
.../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
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..b5b1498
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/Makefile-ptest.patch
@@ -0,0 +1,30 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+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
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.1.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb
index 18a155d..dd4674b 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.34.1.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] = "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,27 @@ 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}
+
+ for subdir in tests glib/tests gobject/tests gio/tests; do
+ mkdir -p ${D}${PTEST_PATH}/$subdir
+ cp ${S}/$subdir/Makefile ${D}${PTEST_PATH}/$subdir
+ cp ${S}/$subdir/.libs/* ${D}${PTEST_PATH}/$subdir
+ done
+
+ cp ${S}/Makefile ${D}${PTEST_PATH}
+ cp ${S}/glib/Makefile ${D}${PTEST_PATH}/glib
+ cp ${S}/glib/.libs/gtester ${D}${PTEST_PATH}/glib
+ cp ${S}/glib/tests/pages.ini ${D}${PTEST_PATH}/glib/tests
+ cp ${S}/glib/tests/keyfiletest.ini ${D}${PTEST_PATH}/glib/tests
+ cp ${S}/glib/tests/empty ${D}${PTEST_PATH}/glib/tests
+ cp ${S}/glib/tests/echo-script ${D}${PTEST_PATH}/glib/tests
+ cp -r ${S}/glib/tests/bookmarks ${D}${PTEST_PATH}/glib/tests
+ cp -r ${S}/glib/tests/markups ${D}${PTEST_PATH}/glib/tests
+
+ find ${D}${PTEST_PATH} -name Makefile | xargs sed -i 's/^Makefile:/_Makefile:/'
+ fi
}
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
index ed9bed9..91225d5 100644
--- a/meta/recipes-core/glib-2.0/glib.inc
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -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}"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/4] Add ptest for dbus.
2012-11-22 16:01 [PATCH 0/4] ptest for master Björn Stenberg
` (2 preceding siblings ...)
2012-11-22 16:01 ` [PATCH 3/4] Add ptest for glib Björn Stenberg
@ 2012-11-22 16:02 ` Björn Stenberg
2012-11-22 16:06 ` Otavio Salvador
2012-11-23 21:46 ` Richard Purdie
3 siblings, 2 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-11-22 16:02 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.
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 4/4] Add ptest for dbus.
2012-11-22 16:02 ` [PATCH 4/4] Add ptest for dbus Björn Stenberg
@ 2012-11-22 16:06 ` Otavio Salvador
2012-11-23 21:46 ` Richard Purdie
1 sibling, 0 replies; 15+ messages in thread
From: Otavio Salvador @ 2012-11-22 16:06 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
On Thu, Nov 22, 2012 at 2:02 PM, Björn Stenberg <bjst@enea.com> wrote:
> 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>
...
> @@ -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?
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/4] Add ptest for dbus.
2012-11-22 16:02 ` [PATCH 4/4] Add ptest for dbus Björn Stenberg
2012-11-22 16:06 ` Otavio Salvador
@ 2012-11-23 21:46 ` Richard Purdie
1 sibling, 0 replies; 15+ messages in thread
From: Richard Purdie @ 2012-11-23 21:46 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
On Thu, 2012-11-22 at 17:02 +0100, Björn Stenberg wrote:
> 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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] Add a new distro feature "ptest".
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
0 siblings, 2 replies; 15+ messages in thread
From: Richard Purdie @ 2012-11-23 21:49 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
On Thu, 2012-11-22 at 17:01 +0100, Björn Stenberg wrote:
> 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/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
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 7b24e4e..b574545 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 e0e5b1c..b5be048 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/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 450a0ee..d86e999 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -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
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/4] Add ptest for glib.
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
1 sibling, 0 replies; 15+ messages in thread
From: Richard Purdie @ 2012-11-23 21:50 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
On Thu, 2012-11-22 at 17:01 +0100, Björn Stenberg wrote:
> diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
> index ed9bed9..91225d5 100644
> --- a/meta/recipes-core/glib-2.0/glib.inc
> +++ b/meta/recipes-core/glib-2.0/glib.inc
> @@ -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}"
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] Add ptest for glib.
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
1 sibling, 0 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-11-28 13:32 UTC (permalink / raw)
To: openembedded-core
Moved install logic from recipe to makefiles.
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.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
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..a6cc719
--- /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) 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
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.1.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb
index 18a155d..9b51c56 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.34.1.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.34.1.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] = "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
}
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
index ed9bed9..1c83f96 100644
--- a/meta/recipes-core/glib-2.0/glib.inc
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -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}"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] Add a new distro feature "ptest".
2012-11-23 21:49 ` Richard Purdie
@ 2012-11-28 14:44 ` Björn Stenberg
2012-11-29 15:52 ` Björn Stenberg
1 sibling, 0 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-11-28 14:44 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
Richard Purdie wrote:
> 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.
--
Björn
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] Add a new distro feature "ptest".
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
1 sibling, 1 reply; 15+ messages in thread
From: Björn Stenberg @ 2012-11-29 15:52 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
Richard Purdie wrote:
> > 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?
--
Björn
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] Add a new distro feature "ptest".
2012-11-29 15:52 ` Björn Stenberg
@ 2012-12-04 16:49 ` Richard Purdie
2012-12-05 10:17 ` Björn Stenberg
0 siblings, 1 reply; 15+ messages in thread
From: Richard Purdie @ 2012-12-04 16:49 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
On Thu, 2012-11-29 at 16:52 +0100, Björn Stenberg wrote:
> Richard Purdie wrote:
> > > 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.
Those are pretty non-invasive so I think we can just add these pieces in
directly as you have them now.
> 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
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] Add a new distro feature "ptest".
2012-12-04 16:49 ` Richard Purdie
@ 2012-12-05 10:17 ` Björn Stenberg
0 siblings, 0 replies; 15+ messages in thread
From: Björn Stenberg @ 2012-12-05 10:17 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
Richard Purdie wrote:
> 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.
--
Björn
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-12-05 10:31 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 4/4] Add ptest for dbus Björn Stenberg
2012-11-22 16:06 ` 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 1/4] Add a new distro feature "ptest" Björn Stenberg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.