From: Jesse Zhang <sen.zhang@windriver.com>
To: "Björn Stenberg" <bjst@enea.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/1] perl-tests: convert to ptest
Date: Tue, 21 May 2013 10:43:04 +0800 [thread overview]
Message-ID: <519ADF38.5090803@windriver.com> (raw)
In-Reply-To: <20130517093129.GC25918@sestofb10.enea.se>
[-- Attachment #1: Type: text/plain, Size: 6018 bytes --]
On 05/17/2013 05:31 PM, Björn Stenberg wrote:
> Unless there are clear advantages with patching t/TEST that I have overlooked, I suggest using sed in run-ptest instead.
Ok.. Here is the new commit.
Removed the patch and added a call to sed in run-ptest. See attachment
for the test log.
From: Jesse Zhang <sen.zhang@windriver.com>
Date: Tue, 14 May 2013 02:53:30 -0400
Subject: [PATCH 1/1] perl-tests: convert to ptest
Replace PERL_TEST_DIR with PTEST_PATH, and rename "tests" with "ptest"
in various places. Also add a run-ptest script.
[YOCTO #4292]
Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
---
meta/recipes-devtools/perl/perl-5.14.3/run-ptest | 2 +
meta/recipes-devtools/perl/perl-ptest.inc | 49 ++++++++++++++++++++++++
meta/recipes-devtools/perl/perl-tests.inc | 36 -----------------
meta/recipes-devtools/perl/perl_5.14.3.bb | 2 +-
4 files changed, 52 insertions(+), 37 deletions(-)
create mode 100644 meta/recipes-devtools/perl/perl-5.14.3/run-ptest
create mode 100644 meta/recipes-devtools/perl/perl-ptest.inc
delete mode 100644 meta/recipes-devtools/perl/perl-tests.inc
diff --git a/meta/recipes-devtools/perl/perl-5.14.3/run-ptest b/meta/recipes-devtools/perl/perl-5.14.3/run-ptest
new file mode 100644
index 0000000..ed59b4b
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.14.3/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+cd t && ./TEST | sed -u -e 's/^\([^. \t]*\)\.\.\.\+ok/PASS: \1/' -e 's/^\([^. \t]*\)\.\.\.\+skipped/SKIP: \1/' -e 's/^\([^. \t]*\)\.\.\.\+\(.*\)/FAIL: \1\n\2/'
diff --git a/meta/recipes-devtools/perl/perl-ptest.inc b/meta/recipes-devtools/perl/perl-ptest.inc
new file mode 100644
index 0000000..caa2b61
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-ptest.inc
@@ -0,0 +1,49 @@
+inherit ptest
+
+SRC_URI += "file://run-ptest \
+ "
+
+do_install_ptest () {
+ mkdir -p ${D}${PTEST_PATH}
+ cp -pv TestInit.pm MANIFEST config.sh ${D}${PTEST_PATH}/
+
+ tar -cf - t/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/
+ ln -sf ${libdir}/perl/${PV} ${D}${PTEST_PATH}/lib
+
+ for dir in `find ext/ dist/ cpan/ -maxdepth 2 -type d -name t ` ; do
+ tar -cf - $dir | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ done
+ for file in `find ext dist cpan -name \*.t -o -name \test.pl`; do
+ tar -cf - $file | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ done
+
+ # Tweaks to make tests pass
+ cp -pv lib/unicore/TestProp.pl ${D}${libdir}/perl/${PV}/unicore/
+ # Put all *.t files from the lib dir in the ptest package
+ pushd lib
+ for file in `find -name \*.t`; do
+ tar -cf - $file | ( cd ${D}${libdir}/perl/${PV} && tar -xf - )
+ done
+ popd
+
+ mkdir -p ${D}${libdir}/perl/${PV}/XS
+ cp -pv lib/XS/APItest.pm ${D}${libdir}/perl/${PV}/XS/
+ cp -pv lib/XS/Typemap.pm ${D}${libdir}/perl/${PV}/XS/
+ mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/APItest
+ cp -pv lib/auto/XS/APItest/APItest.so ${D}${libdir}/perl/${PV}/auto/XS/APItest/
+ mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/Typemap
+ cp -pv lib/auto/XS/Typemap/Typemap.so ${D}${libdir}/perl/${PV}/auto/XS/Typemap/
+ cp -pv cpan/Digest-MD5/README ${D}${PTEST_PATH}/cpan/Digest-MD5/
+ cp -pv cpan/Digest-MD5/MD5.xs ${D}${PTEST_PATH}/cpan/Digest-MD5/
+}
+
+python populate_packages_prepend() {
+ # Put all *.t files from the lib dir in the ptest package
+ # do_split_packages requires a pair of () in the regex, but we have nothing
+ # to match, so use an empty pair.
+ do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()',
+ '${PN}-ptest%s', '%s', recursive=True, match_path=True)
+}
+
+RDEPENDS_${PN}-ptest += "${PN}-modules ${PN}-doc ${PN}-misc"
diff --git a/meta/recipes-devtools/perl/perl-tests.inc b/meta/recipes-devtools/perl/perl-tests.inc
deleted file mode 100644
index b97b467..0000000
--- a/meta/recipes-devtools/perl/perl-tests.inc
+++ /dev/null
@@ -1,36 +0,0 @@
-PACKAGES += "perl-tests"
-PERL_TEST_DIR = "/opt/perl-tests"
-
-do_install_append () {
- mkdir -p ${D}${PERL_TEST_DIR}
- cp -pv TestInit.pm MANIFEST config.sh ${D}${PERL_TEST_DIR}/
-
- tar -cf - t/ | ( cd ${D}${PERL_TEST_DIR} && tar -xf - )
- ln -sf ${bindir}/perl ${D}${PERL_TEST_DIR}/t/
- ln -sf ${libdir}/perl/${PV} ${D}${PERL_TEST_DIR}/lib
-
- for dir in `find ext/ dist/ cpan/ -maxdepth 2 -type d -name t ` ; do
- tar -cf - $dir | ( cd ${D}${PERL_TEST_DIR} && tar -xf - )
- done
- for file in `find ext dist cpan -name \*.t -o -name \test.pl`; do
- tar -cf - $file | ( cd ${D}${PERL_TEST_DIR} && tar -xf - )
- done
-
- # Tweaks to make tests pass
- cp -pv lib/unicore/TestProp.pl ${D}${libdir}/perl/${PV}/unicore/
- cp -pv lib/AnyDBM_File.t ${D}${libdir}/perl/${PV}/
-
- mkdir -p ${D}${libdir}/perl/${PV}/XS
- cp -pv lib/XS/APItest.pm ${D}${libdir}/perl/${PV}/XS/
- cp -pv lib/XS/Typemap.pm ${D}${libdir}/perl/${PV}/XS/
- mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/APItest
- cp -pv lib/auto/XS/APItest/APItest.so ${D}${libdir}/perl/${PV}/auto/XS/APItest/
- mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/Typemap
- cp -pv lib/auto/XS/Typemap/Typemap.so ${D}${libdir}/perl/${PV}/auto/XS/Typemap/
- cp -pv cpan/Digest-MD5/README ${D}${PERL_TEST_DIR}/cpan/Digest-MD5/
- cp -pv cpan/Digest-MD5/MD5.xs ${D}${PERL_TEST_DIR}/cpan/Digest-MD5/
-}
-
-FILES_${PN}-tests = "${PERL_TEST_DIR} \
- ${libdir}/perl/${PV}/AnyDBM_File.t"
-RDEPENDS_${PN}-tests = "${PN}-modules ${PN}-doc ${PN}-misc"
diff --git a/meta/recipes-devtools/perl/perl_5.14.3.bb b/meta/recipes-devtools/perl/perl_5.14.3.bb
index 72efc63..9915042 100644
--- a/meta/recipes-devtools/perl/perl_5.14.3.bb
+++ b/meta/recipes-devtools/perl/perl_5.14.3.bb
@@ -324,7 +324,7 @@ RPROVIDES_perl-lib = "perl-lib"
require perl-rdepends_${PV}.inc
require perl-rprovides.inc
require perl-rprovides_${PV}.inc
-include perl-tests.inc
+require perl-ptest.inc
SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
--
1.7.11.7
[-- Attachment #2: test-log.2 --]
[-- Type: application/x-troff-man, Size: 149944 bytes --]
next prev parent reply other threads:[~2013-05-21 2:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 5:22 [PATCH v2 0/1] perl-tests: convert to ptest Jesse Zhang
2013-05-17 5:22 ` [PATCH 1/1] " Jesse Zhang
2013-05-17 9:31 ` Björn Stenberg
2013-05-21 2:43 ` Jesse Zhang [this message]
2013-05-21 13:50 ` Björn Stenberg
-- strict thread matches above, loose matches on Subject: below --
2013-05-14 7:57 [PATCH 0/1] " Jesse Zhang
2013-05-14 7:57 ` [PATCH 1/1] " Jesse Zhang
2013-05-14 12:58 ` Björn Stenberg
2013-05-15 7:39 ` Jesse Zhang
2013-05-15 11:01 ` Björn Stenberg
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=519ADF38.5090803@windriver.com \
--to=sen.zhang@windriver.com \
--cc=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 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.