* [PATCH 0/3] RFC: Package testing
@ 2012-08-31 14:10 Björn Stenberg
2012-08-31 14:10 ` [PATCH 1/3] Add -ptest package group Björn Stenberg
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Björn Stenberg @ 2012-08-31 14:10 UTC (permalink / raw)
To: openembedded-core
(An earlier version of this was posted to the yocto list last week:
https://lists.yoctoproject.org/pipermail/yocto/2012-August/011166.html)
This is a first set of patches implementing the package testing concept
I proposed in
https://lists.yoctoproject.org/pipermail/yocto/2012-June/009443.html
In summary, the proposal creates a new package group called -ptest that
contains the test suites included with many source packages, compiled to
run on target.
Packaging the test suites sometimes requires patching makefiles to allow
test tools to be cross-compiled. And it sometimes requires patching
and/or translation of the test output to produce a generic output format
that can be automatically parsed. I have included an example patch for
bash that does just that.
I have also included "ptest-runnner", a simple script to find and run
all installed ptests.
The idea is to eventually upstream these changes, both for the benefit
of the entire ecosystem and of course to reduce the number of patches.
However I won't downplay the effort required to get hundreds of upstream
projects to agree on a common concept for test cross compilation and
result formatting.
I see two main options: Implement first or discuss first.
a) Implement first: We design and implement a good system for yocto/oe
and then, once it has proven itself, engage the larger open source
community with our already tested concept.
Pro: It's easier to discuss an already working system
Con: We'll have to manage patches for all packages until agreement
b) Discuss first: We invite the whole open source community to discuss
and try to agree on how to handle cross-compiled test cases and test
result formatting before we implement anything.
Pro: No increased patch load until agreement
Con: No result until agreement, which could potentially take a long time
My suggestion is a). I'm open for all suggestions that would make the
patch load easier to manage.
Björn Stenberg (3):
Add -ptest package group
Enable bash-ptest
New recipe: ptest-runner
meta/classes/distutils-common-base.bbclass | 5 ++-
meta/classes/image.bbclass | 6 ++-
meta/classes/task.bbclass | 2 +-
meta/conf/bitbake.conf | 12 ++++++-
.../bash/bash-4.2/build-tests.patch | 34 ++++++++++++++++++++
meta/recipes-extended/bash/bash-4.2/run-ptest | 2 +
.../bash/bash-4.2/test-output.patch | 19 +++++++++++
meta/recipes-extended/bash/bash.inc | 23 +++++++++++++
meta/recipes-extended/bash/bash_4.2.bb | 5 ++-
.../ptest-runner/files/ptest-runner | 16 +++++++++
.../ptest-runner/ptest-runner_1.0.bb | 17 ++++++++++
11 files changed, 135 insertions(+), 6 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
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] 10+ messages in thread
* [PATCH 1/3] Add -ptest package group
2012-08-31 14:10 [PATCH 0/3] RFC: Package testing Björn Stenberg
@ 2012-08-31 14:10 ` Björn Stenberg
2012-09-01 18:21 ` Koen Kooi
2012-08-31 14:10 ` [PATCH 2/3] Enable bash-ptest Björn Stenberg
2012-08-31 14:10 ` [PATCH 3/3] New recipe: ptest-runner Björn Stenberg
2 siblings, 1 reply; 10+ messages in thread
From: Björn Stenberg @ 2012-08-31 14:10 UTC (permalink / raw)
To: openembedded-core
This patch creates a new package group -ptest to contain the tests from
each package.
Signed-off-by: Björn Stenberg <bjst@enea.com>
---
meta/classes/distutils-common-base.bbclass | 5 ++++-
meta/classes/image.bbclass | 6 ++++--
meta/classes/task.bbclass | 2 +-
meta/conf/bitbake.conf | 12 +++++++++++-
4 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/meta/classes/distutils-common-base.bbclass b/meta/classes/distutils-common-base.bbclass
index f66a5cd..7db015b 100644
--- a/meta/classes/distutils-common-base.bbclass
+++ b/meta/classes/distutils-common-base.bbclass
@@ -5,7 +5,7 @@ EXTRA_OEMAKE = ""
export STAGING_INCDIR
export STAGING_LIBDIR
-PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc ${PN}"
+PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-ptest ${PN}-doc ${PN}"
FILES_${PN} = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*"
@@ -19,3 +19,6 @@ FILES_${PN}-dbg += "\
${PYTHON_SITEPACKAGES_DIR}/*/.debug \
${PYTHON_SITEPACKAGES_DIR}/*/*/.debug \
"
+FILES_${PN}-ptest += "\
+ ${PYTHON_SITEPACKAGES_DIR}/${PTEST_NAME} \
+"
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 72720f1..c154bc2 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)
@@ -53,6 +53,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/task.bbclass b/meta/classes/task.bbclass
index 6ec154a..653f149 100644
--- a/meta/classes/task.bbclass
+++ b/meta/classes/task.bbclass
@@ -20,7 +20,7 @@ python () {
packages = d.getVar('PACKAGES', True).split()
genpackages = []
for pkg in packages:
- for postfix in ['-dbg', '-dev']:
+ for postfix in ['-dbg', '-ptest', '-dev']:
genpackages.append(pkg+postfix)
d.setVar('PACKAGES', ' '.join(packages+genpackages))
}
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 7dfeda3..d10e933 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -220,6 +220,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 \
@@ -263,7 +267,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 = ""
@@ -307,6 +311,12 @@ 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})"
+
FILES_${PN}-locale = "${datadir}/locale"
# File manifest
--
1.7.5.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/3] Enable bash-ptest
2012-08-31 14:10 [PATCH 0/3] RFC: Package testing Björn Stenberg
2012-08-31 14:10 ` [PATCH 1/3] Add -ptest package group Björn Stenberg
@ 2012-08-31 14:10 ` Björn Stenberg
2012-08-31 15:32 ` Saul Wold
2012-08-31 14:10 ` [PATCH 3/3] New recipe: ptest-runner Björn Stenberg
2 siblings, 1 reply; 10+ messages in thread
From: Björn Stenberg @ 2012-08-31 14:10 UTC (permalink / raw)
To: openembedded-core
Patch Makefile.in to allow test programs be built on host and ran on
target.
Patch tests/run-all to output PASS/FAIL for each testcase.
Patch recipe to contitionally build and install ptest.
Signed-off-by: Björn Stenberg <bjst@enea.com>
---
.../bash/bash-4.2/build-tests.patch | 34 ++++++++++++++++++++
meta/recipes-extended/bash/bash-4.2/run-ptest | 2 +
.../bash/bash-4.2/test-output.patch | 19 +++++++++++
meta/recipes-extended/bash/bash.inc | 23 +++++++++++++
meta/recipes-extended/bash/bash_4.2.bb | 5 ++-
5 files changed, 82 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..17276c7
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-4.2/build-tests.patch
@@ -0,0 +1,34 @@
+diff -uNr a/Makefile.in b/Makefile.in
+--- a/Makefile.in 2012-08-31 13:54:15.259491840 +0200
++++ b/Makefile.in 2012-08-31 14:54:46.508053649 +0200
+@@ -827,20 +827,26 @@
+ 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) buildtest
++ @$(MAKE) runtest
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
+ @-test -d tests || mkdir tests
+ @cp $(TESTS_SUPPORT) tests
++
++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..8dd3b99
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-4.2/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -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..065a85c
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-4.2/test-output.patch
@@ -0,0 +1,19 @@
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all 2012-06-14 10:15:15.007467700 +0200
++++ b/tests/run-all 2012-06-14 10:19:26.464678067 +0200
+@@ -22,6 +22,14 @@
+ 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 3684191..7f7a965 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -21,18 +21,41 @@ ALTERNATIVE_PRIORITY = "100"
export AUTOHEADER = "true"
+RDEPENDS_${PN}-ptest += "make"
+FILES_${PN}-dbg += "${PTEST_PATH}/.debug \
+ ${PTEST_PATH}/tests/.debug"
+
+PTEST_ENABLED = "${@base_contains('IMAGE_FEATURES', 'ptest-pkgs', '1', '0', d)}"
+
do_configure_prepend () {
if [ ! -e acinclude.m4 ]; then
cat aclocal.m4 > acinclude.m4
fi
}
+do_compile_append () {
+ if [ ${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
+ mkdir -p ${D}${PTEST_PATH}
+ install -m 0755 ${WORKDIR}/run-ptest ${D}${PTEST_PATH}
+ install -m 0755 ${B}/Makefile ${D}${PTEST_PATH}
+ install -m 0755 ${B}/recho ${D}${PTEST_PATH}
+ install -m 0755 ${B}/zecho ${D}${PTEST_PATH}
+ install -m 0755 ${B}/printenv ${D}${PTEST_PATH}
+ install -m 0755 ${B}/xcase ${D}${PTEST_PATH}
+ cp -r ${B}/tests ${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 50f2ff6..5e9b50e 100644
--- a/meta/recipes-extended/bash/bash_4.2.bb
+++ b/meta/recipes-extended/bash/bash_4.2.bb
@@ -1,6 +1,6 @@
require bash.inc
-PR = "r4"
+PR = "r5"
SRC_URI = "${GNU_MIRROR}/bash/${BPN}-${PV}.tar.gz;name=tarball \
${GNU_MIRROR}/bash/bash-4.2-patches/bash42-001;apply=yes;striplevel=0;name=patch001 \
@@ -14,6 +14,9 @@ SRC_URI = "${GNU_MIRROR}/bash/${BPN}-${PV}.tar.gz;name=tarball \
${GNU_MIRROR}/bash/bash-4.2-patches/bash42-009;apply=yes;striplevel=0;name=patch009 \
${GNU_MIRROR}/bash/bash-4.2-patches/bash42-010;apply=yes;striplevel=0;name=patch010 \
file://execute_cmd.patch;striplevel=0 \
+ 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] 10+ messages in thread
* [PATCH 3/3] New recipe: ptest-runner
2012-08-31 14:10 [PATCH 0/3] RFC: Package testing Björn Stenberg
2012-08-31 14:10 ` [PATCH 1/3] Add -ptest package group Björn Stenberg
2012-08-31 14:10 ` [PATCH 2/3] Enable bash-ptest Björn Stenberg
@ 2012-08-31 14:10 ` Björn Stenberg
2 siblings, 0 replies; 10+ messages in thread
From: Björn Stenberg @ 2012-08-31 14:10 UTC (permalink / raw)
To: openembedded-core
This package contains the top-level script that seeks out and starts all
package tests.
---
.../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..7c5475e
--- /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 [ -d "/usr/lib/$x/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] 10+ messages in thread
* Re: [PATCH 2/3] Enable bash-ptest
2012-08-31 14:10 ` [PATCH 2/3] Enable bash-ptest Björn Stenberg
@ 2012-08-31 15:32 ` Saul Wold
2012-08-31 17:01 ` Björn Stenberg
2012-08-31 20:57 ` Khem Raj
0 siblings, 2 replies; 10+ messages in thread
From: Saul Wold @ 2012-08-31 15:32 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
On 08/31/2012 07:10 AM, Björn Stenberg wrote:
> Patch Makefile.in to allow test programs be built on host and ran on
> target.
> Patch tests/run-all to output PASS/FAIL for each testcase.
> Patch recipe to contitionally build and install ptest.
>
> Signed-off-by: Björn Stenberg <bjst@enea.com>
> ---
> .../bash/bash-4.2/build-tests.patch | 34 ++++++++++++++++++++
> meta/recipes-extended/bash/bash-4.2/run-ptest | 2 +
> .../bash/bash-4.2/test-output.patch | 19 +++++++++++
> meta/recipes-extended/bash/bash.inc | 23 +++++++++++++
> meta/recipes-extended/bash/bash_4.2.bb | 5 ++-
> 5 files changed, 82 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
>
You new patches still need patch headers with Upstream-Status and
Signed-off-by tags. Please review
http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
> 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..17276c7
> --- /dev/null
> +++ b/meta/recipes-extended/bash/bash-4.2/build-tests.patch
> @@ -0,0 +1,34 @@
> +diff -uNr a/Makefile.in b/Makefile.in
> +--- a/Makefile.in 2012-08-31 13:54:15.259491840 +0200
> ++++ b/Makefile.in 2012-08-31 14:54:46.508053649 +0200
> +@@ -827,20 +827,26 @@
> + 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) buildtest
> ++ @$(MAKE) runtest
> ++
> ++buildtest: force $(Program) $(TESTS_SUPPORT)
> + @-test -d tests || mkdir tests
> + @cp $(TESTS_SUPPORT) tests
> ++
> ++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..8dd3b99
> --- /dev/null
> +++ b/meta/recipes-extended/bash/bash-4.2/run-ptest
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +make -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..065a85c
> --- /dev/null
> +++ b/meta/recipes-extended/bash/bash-4.2/test-output.patch
> @@ -0,0 +1,19 @@
> +diff -uNr a/tests/run-all b/tests/run-all
> +--- a/tests/run-all 2012-06-14 10:15:15.007467700 +0200
> ++++ b/tests/run-all 2012-06-14 10:19:26.464678067 +0200
> +@@ -22,6 +22,14 @@
> + 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 3684191..7f7a965 100644
> --- a/meta/recipes-extended/bash/bash.inc
> +++ b/meta/recipes-extended/bash/bash.inc
> @@ -21,18 +21,41 @@ ALTERNATIVE_PRIORITY = "100"
>
> export AUTOHEADER = "true"
>
> +RDEPENDS_${PN}-ptest += "make"
> +FILES_${PN}-dbg += "${PTEST_PATH}/.debug \
> + ${PTEST_PATH}/tests/.debug"
> +
> +PTEST_ENABLED = "${@base_contains('IMAGE_FEATURES', 'ptest-pkgs', '1', '0', d)}"
> +
Should this be a DISTRO or IMAGE FEATURE? I can see potential arguments
for both sides, what was your thinking on choosing IMAGE over DISTRO?
Sau!
> do_configure_prepend () {
> if [ ! -e acinclude.m4 ]; then
> cat aclocal.m4 > acinclude.m4
> fi
> }
>
> +do_compile_append () {
> + if [ ${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
> + mkdir -p ${D}${PTEST_PATH}
> + install -m 0755 ${WORKDIR}/run-ptest ${D}${PTEST_PATH}
> + install -m 0755 ${B}/Makefile ${D}${PTEST_PATH}
> + install -m 0755 ${B}/recho ${D}${PTEST_PATH}
> + install -m 0755 ${B}/zecho ${D}${PTEST_PATH}
> + install -m 0755 ${B}/printenv ${D}${PTEST_PATH}
> + install -m 0755 ${B}/xcase ${D}${PTEST_PATH}
> + cp -r ${B}/tests ${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 50f2ff6..5e9b50e 100644
> --- a/meta/recipes-extended/bash/bash_4.2.bb
> +++ b/meta/recipes-extended/bash/bash_4.2.bb
> @@ -1,6 +1,6 @@
> require bash.inc
>
> -PR = "r4"
> +PR = "r5"
>
> SRC_URI = "${GNU_MIRROR}/bash/${BPN}-${PV}.tar.gz;name=tarball \
> ${GNU_MIRROR}/bash/bash-4.2-patches/bash42-001;apply=yes;striplevel=0;name=patch001 \
> @@ -14,6 +14,9 @@ SRC_URI = "${GNU_MIRROR}/bash/${BPN}-${PV}.tar.gz;name=tarball \
> ${GNU_MIRROR}/bash/bash-4.2-patches/bash42-009;apply=yes;striplevel=0;name=patch009 \
> ${GNU_MIRROR}/bash/bash-4.2-patches/bash42-010;apply=yes;striplevel=0;name=patch010 \
> file://execute_cmd.patch;striplevel=0 \
> + file://build-tests.patch \
> + file://test-output.patch \
> + file://run-ptest \
> "
>
> SRC_URI[tarball.md5sum] = "3fb927c7c33022f1c327f14a81c0d4b0"
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] Enable bash-ptest
2012-08-31 15:32 ` Saul Wold
@ 2012-08-31 17:01 ` Björn Stenberg
2012-08-31 17:16 ` Saul Wold
2012-08-31 20:57 ` Khem Raj
1 sibling, 1 reply; 10+ messages in thread
From: Björn Stenberg @ 2012-08-31 17:01 UTC (permalink / raw)
To: Saul Wold; +Cc: openembedded-core
Saul Wold wrote:
> You new patches still need patch headers with Upstream-Status and
> Signed-off-by tags.
Ouch, sorry about that. I added Signed-off but forgot upstream. I'll be more careful next time.
> Should this be a DISTRO or IMAGE FEATURE? I can see potential
> arguments for both sides, what was your thinking on choosing IMAGE
> over DISTRO?
I chose IMAGE since that is how the -dbg and -dev package groups are enabled, and -ptest is modeled after them. Also we have the EXTRA_IMAGE_FEATURES setting that can be used to enable this temporarily while I don't know if we have anything similar for DISTRO_FEATURES?
--
Björn
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] Enable bash-ptest
2012-08-31 17:01 ` Björn Stenberg
@ 2012-08-31 17:16 ` Saul Wold
0 siblings, 0 replies; 10+ messages in thread
From: Saul Wold @ 2012-08-31 17:16 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
On 08/31/2012 10:01 AM, Björn Stenberg wrote:
> Saul Wold wrote:
>> You new patches still need patch headers with Upstream-Status and
>> Signed-off-by tags.
>
> Ouch, sorry about that. I added Signed-off but forgot upstream. I'll be more careful next time.
>
Just to be clear these need to be in your busybox patches not the commit
message for the overall patch to OE-Core, I hope that makes sense.
In these two files:
meta/recipes-extended/bash/bash-4.2/build-tests.patch
meta/recipes-extended/bash/bash-4.2/test-output.patch
>> Should this be a DISTRO or IMAGE FEATURE? I can see potential
>> arguments for both sides, what was your thinking on choosing IMAGE
>> over DISTRO?
>
> I chose IMAGE since that is how the -dbg and -dev package groups are enabled, and -ptest is modeled after them. Also we have the EXTRA_IMAGE_FEATURES setting that can be used to enable this temporarily while I don't know if we have anything similar for DISTRO_FEATURES?
>
That makes sense also, I was thinking along the same lines, just wanted
to get your reasoning captured.
Thanks
Sau!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] Enable bash-ptest
2012-08-31 15:32 ` Saul Wold
2012-08-31 17:01 ` Björn Stenberg
@ 2012-08-31 20:57 ` Khem Raj
1 sibling, 0 replies; 10+ messages in thread
From: Khem Raj @ 2012-08-31 20:57 UTC (permalink / raw)
To: Saul Wold; +Cc: openembedded-core
> Should this be a DISTRO or IMAGE FEATURE? I can see potential arguments for
> both sides, what was your thinking on choosing IMAGE over DISTRO?
this is IMAGE_FEATURE that can then be recommended/mandated in a distro policy
is upto distros
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Add -ptest package group
2012-08-31 14:10 ` [PATCH 1/3] Add -ptest package group Björn Stenberg
@ 2012-09-01 18:21 ` Koen Kooi
2012-09-03 7:08 ` Björn Stenberg
0 siblings, 1 reply; 10+ messages in thread
From: Koen Kooi @ 2012-09-01 18:21 UTC (permalink / raw)
To: Björn Stenberg; +Cc: openembedded-core
Op 31 aug. 2012, om 16:10 heeft Björn Stenberg <bjst@enea.com> het volgende geschreven:
> This patch creates a new package group -ptest to contain the tests from
> each package.
These have always been called ${PN}-tests, why the change?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Add -ptest package group
2012-09-01 18:21 ` Koen Kooi
@ 2012-09-03 7:08 ` Björn Stenberg
0 siblings, 0 replies; 10+ messages in thread
From: Björn Stenberg @ 2012-09-03 7:08 UTC (permalink / raw)
To: Koen Kooi; +Cc: openembedded-core
Koen Kooi wrote:
> These have always been called ${PN}-tests, why the change?
When I discussed package testing informally before submitting patches, I found that some people tend to lump all types of testing into one big "Test" bucket and get very confused.
By giving this concept a slightly less generic name, we can discuss it specifically without confusing it with other types of tests.
The existing -tests recipes are, as far as I can see, standalone packages that have little in common with each other. In contrast, -ptest packages are designed to be more like -dev or -dbg packages in that they don't have separate recipes and they share a common interface.
--
Björn
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-09-03 7:20 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31 14:10 [PATCH 0/3] RFC: Package testing Björn Stenberg
2012-08-31 14:10 ` [PATCH 1/3] Add -ptest package group Björn Stenberg
2012-09-01 18:21 ` Koen Kooi
2012-09-03 7:08 ` Björn Stenberg
2012-08-31 14:10 ` [PATCH 2/3] Enable bash-ptest Björn Stenberg
2012-08-31 15:32 ` Saul Wold
2012-08-31 17:01 ` Björn Stenberg
2012-08-31 17:16 ` Saul Wold
2012-08-31 20:57 ` Khem Raj
2012-08-31 14:10 ` [PATCH 3/3] New recipe: ptest-runner 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.