summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl-tests.inc
diff options
context:
space:
mode:
authorKang Kai <kai.kang@windriver.com>2012-12-18 18:16:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-07 11:09:36 +0000
commit61583fe11f2494e37ec0dd6e3bdeadf33f25f199 (patch)
treee29f0d343260bfc62819c1c4e1133211943284a0 /meta/recipes-devtools/perl/perl-tests.inc
parent52c6393375d49ca469aa9e6bfcc608b74fcb1c44 (diff)
downloadpoky-61583fe11f2494e37ec0dd6e3bdeadf33f25f199.tar.gz
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 <kai.kang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/perl/perl-tests.inc')
-rw-r--r--meta/recipes-devtools/perl/perl-tests.inc34
1 files changed, 34 insertions, 0 deletions
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 @@
1PACKAGES += "perl-tests"
2PERL_TEST_DIR = "/opt/perl-tests"
3
4do_install_append () {
5 mkdir -p ${D}${PERL_TEST_DIR}
6 cp -pv TestInit.pm MANIFEST config.sh ${D}${PERL_TEST_DIR}/
7
8 tar -cf - t/ | ( cd ${D}${PERL_TEST_DIR} && tar -xf - )
9 ln -sf ${bindir}/perl ${D}${PERL_TEST_DIR}/t/
10 ln -sf ${libdir}/perl/${PV} ${D}${PERL_TEST_DIR}/lib
11
12 for dir in `find ext/ dist/ cpan/ -maxdepth 2 -type d -name t ` ; do
13 tar -cf - $dir | ( cd ${D}${PERL_TEST_DIR} && tar -xf - )
14 done
15 for file in `find ext dist cpan -name \*.t -o -name \test.pl`; do
16 tar -cf - $file | ( cd ${D}${PERL_TEST_DIR} && tar -xf - )
17 done
18
19 # Tweaks to make tests pass
20 cp -pv lib/unicore/TestProp.pl ${D}${libdir}/perl/${PV}/unicore/
21 cp -pv lib/AnyDBM_File.t ${D}${libdir}/perl/${PV}/
22
23 mkdir -p ${D}${libdir}/perl/${PV}/XS
24 cp -pv lib/XS/{APItest,Typemap}.pm ${D}${libdir}/perl/${PV}/XS/
25 mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/APItest
26 cp -pv lib/auto/XS/APItest/APItest.so ${D}${libdir}/perl/${PV}/auto/XS/APItest/
27 cp -pv lib/auto/XS/Typemap/Typemap.so ${D}${libdir}/perl/${PV}/auto/XS/Typemap/
28
29 cp -pv cpan/Digest-MD5/{README,MD5.xs} ${D}${PERL_TEST_DIR}/cpan/Digest-MD5/
30}
31
32FILES_${PN}-tests = "${PERL_TEST_DIR} \
33 ${libdir}/perl/${PV}/AnyDBM_File.t"
34RDEPENDS_${PN}-tests = "${PN}-modules ${PN}-doc ${PN}-misc"