From 61583fe11f2494e37ec0dd6e3bdeadf33f25f199 Mon Sep 17 00:00:00 2001 From: Kang Kai Date: Tue, 18 Dec 2012 18:16:28 +0800 Subject: perl: add sub-package perl-tests In perl source code, run "make test" will run perl test cases. Put these cases into a seprated sub-package then we can run the perl test on target. Add following module to nonxs_ext to install extra modules that required by perl test cases: CPAN/Meta CPAN/Meta/YAML Dumpvalue Env File/CheckTree HTTP/Tiny I18N/Collate JSON/PP Perl/OSType Version/Requirements Commands to run test: cd /opt/perl-tests/t && ./TEST [Yocto 3296] (From OE-Core rev: 96fb96ddd00881947875518df832fa74faec8a45) Signed-off-by: Kang Kai Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/recipes-devtools/perl/perl-tests.inc | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meta/recipes-devtools/perl/perl-tests.inc (limited to 'meta/recipes-devtools/perl/perl-tests.inc') diff --git a/meta/recipes-devtools/perl/perl-tests.inc b/meta/recipes-devtools/perl/perl-tests.inc new file mode 100644 index 0000000000..c968eb645b --- /dev/null +++ b/meta/recipes-devtools/perl/perl-tests.inc @@ -0,0 +1,34 @@ +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,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/ + cp -pv lib/auto/XS/Typemap/Typemap.so ${D}${libdir}/perl/${PV}/auto/XS/Typemap/ + + cp -pv cpan/Digest-MD5/{README,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" -- cgit v1.2.3-54-g00ecf