Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/4] Move ptest checks from recipes to ptest.bbclass
@ 2013-03-06  9:41 Björn Stenberg
  2013-03-06  9:41 ` [PATCH 1/4] ptest: " Björn Stenberg
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Björn Stenberg @ 2013-03-06  9:41 UTC (permalink / raw)
  To: openembedded-core

In response to feedback about the ptest checks added to recipes when
implementing ptest, I have changed it so those checks now only exist in
ptest.bbclass and recipes instead use dedicated _ptest functions to define
ptest-specific actions.

Björn Stenberg (4):
  ptest: Move ptest checks from recipes to ptest.bbclass
  dbus: Use new _ptest functions
  glib: Use new _ptest functions
  bash: Use new _ptest functions

 meta/classes/ptest.bbclass                    |   35 ++++++++++++++++++++----
 meta/recipes-core/dbus/dbus-ptest_1.6.8.bb    |    4 ++-
 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb |    2 -
 meta/recipes-extended/bash/bash.inc           |   15 ++++------
 4 files changed, 38 insertions(+), 18 deletions(-)

-- 
1.7.5.4




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

* [PATCH 1/4] ptest: Move ptest checks from recipes to ptest.bbclass
  2013-03-06  9:41 [PATCH 0/4] Move ptest checks from recipes to ptest.bbclass Björn Stenberg
@ 2013-03-06  9:41 ` Björn Stenberg
  2013-03-06  9:41 ` [PATCH 2/4] dbus: Use new _ptest functions Björn Stenberg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Björn Stenberg @ 2013-03-06  9:41 UTC (permalink / raw)
  To: openembedded-core

This patch cleans up ptest implementation in recipes by moving ptest
specific code parts into dedicated *_ptest functions.

Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 meta/classes/ptest.bbclass |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
index 131af7b..6ab5ee4 100644
--- a/meta/classes/ptest.bbclass
+++ b/meta/classes/ptest.bbclass
@@ -23,13 +23,36 @@ FILES_${PN}-dbg += "${PTEST_PATH}/.debug \
                     ${PTEST_PATH}/*/*/*/*/.debug \
                    "
 
-ptest_do_install() {
-    if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then
-        install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
-        if grep -q install-ptest: Makefile; then
-            oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
+do_configure_ptest_base() {
+    if [ ${PTEST_ENABLED} = 1 ]; then
+        if [ type -t do_configure_ptest = function ]; then
+            do_configure_ptest
         fi
     fi
 }
 
-EXPORT_FUNCTIONS ptest_do_install
+do_compile_ptest_base() {
+    if [ ${PTEST_ENABLED} = 1 ]; then
+        if [ type -t do_compile_ptest = function ]; then
+            do_compile_ptest
+        fi
+    fi
+}
+
+do_install_ptest_base() {
+    if [ ${PTEST_ENABLED} = 1 ]; then
+        if [ -f ${WORKDIR}/run-ptest ]; then
+            install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
+            if grep -q install-ptest: Makefile; then
+                oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
+            fi
+            if [ type -t do_install_ptest = function ]; then
+                do_install_ptest
+            fi
+        fi
+    fi
+}
+
+addtask configure_ptest_base after do_configure before do_compile
+addtask compile_ptest_base   after do_compile   before do_install
+addtask install_ptest_base   after do_install   before do_package
-- 
1.7.5.4




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

* [PATCH 2/4] dbus: Use new _ptest functions
  2013-03-06  9:41 [PATCH 0/4] Move ptest checks from recipes to ptest.bbclass Björn Stenberg
  2013-03-06  9:41 ` [PATCH 1/4] ptest: " Björn Stenberg
@ 2013-03-06  9:41 ` Björn Stenberg
  2013-03-06  9:41 ` [PATCH 3/4] glib: " Björn Stenberg
  2013-03-06  9:41 ` [PATCH 4/4] bash: " Björn Stenberg
  3 siblings, 0 replies; 5+ messages in thread
From: Björn Stenberg @ 2013-03-06  9:41 UTC (permalink / raw)
  To: openembedded-core


Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 meta/recipes-core/dbus/dbus-ptest_1.6.8.bb |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-core/dbus/dbus-ptest_1.6.8.bb b/meta/recipes-core/dbus/dbus-ptest_1.6.8.bb
index 1382206..d00819a 100644
--- a/meta/recipes-core/dbus/dbus-ptest_1.6.8.bb
+++ b/meta/recipes-core/dbus/dbus-ptest_1.6.8.bb
@@ -41,6 +41,8 @@ EXTRA_OECONF = "--enable-tests \
                 ${EXTRA_OECONF_X}"
 
 do_install() {
-    ptest_do_install
+}
+
+do_install_ptest() {
     find ${D}${PTEST_PATH} -name Makefile | xargs sed -i 's/^Makefile:/_Makefile:/'
 }
-- 
1.7.5.4




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

* [PATCH 3/4] glib: Use new _ptest functions
  2013-03-06  9:41 [PATCH 0/4] Move ptest checks from recipes to ptest.bbclass Björn Stenberg
  2013-03-06  9:41 ` [PATCH 1/4] ptest: " Björn Stenberg
  2013-03-06  9:41 ` [PATCH 2/4] dbus: Use new _ptest functions Björn Stenberg
@ 2013-03-06  9:41 ` Björn Stenberg
  2013-03-06  9:41 ` [PATCH 4/4] bash: " Björn Stenberg
  3 siblings, 0 replies; 5+ messages in thread
From: Björn Stenberg @ 2013-03-06  9:41 UTC (permalink / raw)
  To: openembedded-core


Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
index d58d489..7795524 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
@@ -60,6 +60,4 @@ do_install_append() {
   if [ -f ${D}${bindir}/glib-mkenums ]; then
     sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums
   fi
-
-  ptest_do_install
 }
-- 
1.7.5.4




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

* [PATCH 4/4] bash: Use new _ptest functions
  2013-03-06  9:41 [PATCH 0/4] Move ptest checks from recipes to ptest.bbclass Björn Stenberg
                   ` (2 preceding siblings ...)
  2013-03-06  9:41 ` [PATCH 3/4] glib: " Björn Stenberg
@ 2013-03-06  9:41 ` Björn Stenberg
  3 siblings, 0 replies; 5+ messages in thread
From: Björn Stenberg @ 2013-03-06  9:41 UTC (permalink / raw)
  To: openembedded-core


Signed-off-by: Björn Stenberg <bjst@enea.com>
---
 meta/recipes-extended/bash/bash.inc |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index 20a23f0..c619f82 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -25,10 +25,8 @@ do_configure_prepend () {
 	fi
 }
 
-do_compile_append () {
-        if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then
-            oe_runmake buildtest
-        fi
+do_compile_ptest () {
+	oe_runmake buildtest
 }
 
 do_install_append () {
@@ -37,12 +35,11 @@ do_install_append () {
 		mkdir -p ${D}${base_bindir}
 		mv ${D}${bindir}/bash ${D}${base_bindir}
 	fi
+}
 
-        if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then
-            ptest_do_install
-            make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
-            cp ${B}/Makefile ${D}${PTEST_PATH}
-        fi
+do_install_ptest () {
+	make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
+	cp ${B}/Makefile ${D}${PTEST_PATH}
 }
 
 pkg_postinst_${PN} () {
-- 
1.7.5.4




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

end of thread, other threads:[~2013-03-06  9:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06  9:41 [PATCH 0/4] Move ptest checks from recipes to ptest.bbclass Björn Stenberg
2013-03-06  9:41 ` [PATCH 1/4] ptest: " Björn Stenberg
2013-03-06  9:41 ` [PATCH 2/4] dbus: Use new _ptest functions Björn Stenberg
2013-03-06  9:41 ` [PATCH 3/4] glib: " Björn Stenberg
2013-03-06  9:41 ` [PATCH 4/4] bash: " Björn Stenberg

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