Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Björn Stenberg" <bjst@enea.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 3/4] Add ptest for glib.
Date: Thu, 22 Nov 2012 17:01:59 +0100	[thread overview]
Message-ID: <1353600120-22967-4-git-send-email-bjst@enea.com> (raw)
In-Reply-To: <1353600120-22967-1-git-send-email-bjst@enea.com>

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




  parent reply	other threads:[~2012-11-22 16:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Björn Stenberg [this message]
2012-11-23 21:50   ` [PATCH 3/4] Add ptest for glib 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353600120-22967-4-git-send-email-bjst@enea.com \
    --to=bjst@enea.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox