From 73b752897d8a4a9159d056d0c905e9076c30fcea Mon Sep 17 00:00:00 2001 From: Jesse Zhang Date: Tue, 21 May 2013 10:43:04 +0800 Subject: perl-tests: convert to ptest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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] (From OE-Core rev: 364cad5d8eecfec74a7be8cf93e75cd63031101f) Signed-off-by: Jesse Zhang Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/recipes-devtools/perl/perl-ptest.inc | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 meta/recipes-devtools/perl/perl-ptest.inc (limited to 'meta/recipes-devtools/perl/perl-ptest.inc') diff --git a/meta/recipes-devtools/perl/perl-ptest.inc b/meta/recipes-devtools/perl/perl-ptest.inc new file mode 100644 index 0000000000..caa2b61c9b --- /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" -- cgit v1.2.3-54-g00ecf