summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/perl')
-rw-r--r--meta/recipes-devtools/perl/perl-5.14.3/run-ptest2
-rw-r--r--meta/recipes-devtools/perl/perl-ptest.inc49
-rw-r--r--meta/recipes-devtools/perl/perl-tests.inc36
-rw-r--r--meta/recipes-devtools/perl/perl_5.14.3.bb2
4 files changed, 52 insertions, 37 deletions
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 0000000000..ed59b4b145
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.14.3/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2cd 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 0000000000..caa2b61c9b
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-ptest.inc
@@ -0,0 +1,49 @@
1inherit ptest
2
3SRC_URI += "file://run-ptest \
4 "
5
6do_install_ptest () {
7 mkdir -p ${D}${PTEST_PATH}
8 cp -pv TestInit.pm MANIFEST config.sh ${D}${PTEST_PATH}/
9
10 tar -cf - t/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
11 ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/
12 ln -sf ${libdir}/perl/${PV} ${D}${PTEST_PATH}/lib
13
14 for dir in `find ext/ dist/ cpan/ -maxdepth 2 -type d -name t ` ; do
15 tar -cf - $dir | ( cd ${D}${PTEST_PATH} && tar -xf - )
16 done
17 for file in `find ext dist cpan -name \*.t -o -name \test.pl`; do
18 tar -cf - $file | ( cd ${D}${PTEST_PATH} && tar -xf - )
19 done
20
21 # Tweaks to make tests pass
22 cp -pv lib/unicore/TestProp.pl ${D}${libdir}/perl/${PV}/unicore/
23 # Put all *.t files from the lib dir in the ptest package
24 pushd lib
25 for file in `find -name \*.t`; do
26 tar -cf - $file | ( cd ${D}${libdir}/perl/${PV} && tar -xf - )
27 done
28 popd
29
30 mkdir -p ${D}${libdir}/perl/${PV}/XS
31 cp -pv lib/XS/APItest.pm ${D}${libdir}/perl/${PV}/XS/
32 cp -pv lib/XS/Typemap.pm ${D}${libdir}/perl/${PV}/XS/
33 mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/APItest
34 cp -pv lib/auto/XS/APItest/APItest.so ${D}${libdir}/perl/${PV}/auto/XS/APItest/
35 mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/Typemap
36 cp -pv lib/auto/XS/Typemap/Typemap.so ${D}${libdir}/perl/${PV}/auto/XS/Typemap/
37 cp -pv cpan/Digest-MD5/README ${D}${PTEST_PATH}/cpan/Digest-MD5/
38 cp -pv cpan/Digest-MD5/MD5.xs ${D}${PTEST_PATH}/cpan/Digest-MD5/
39}
40
41python populate_packages_prepend() {
42 # Put all *.t files from the lib dir in the ptest package
43 # do_split_packages requires a pair of () in the regex, but we have nothing
44 # to match, so use an empty pair.
45 do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()',
46 '${PN}-ptest%s', '%s', recursive=True, match_path=True)
47}
48
49RDEPENDS_${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 b97b46781d..0000000000
--- a/meta/recipes-devtools/perl/perl-tests.inc
+++ /dev/null
@@ -1,36 +0,0 @@
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.pm ${D}${libdir}/perl/${PV}/XS/
25 cp -pv lib/XS/Typemap.pm ${D}${libdir}/perl/${PV}/XS/
26 mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/APItest
27 cp -pv lib/auto/XS/APItest/APItest.so ${D}${libdir}/perl/${PV}/auto/XS/APItest/
28 mkdir -p ${D}${libdir}/perl/${PV}/auto/XS/Typemap
29 cp -pv lib/auto/XS/Typemap/Typemap.so ${D}${libdir}/perl/${PV}/auto/XS/Typemap/
30 cp -pv cpan/Digest-MD5/README ${D}${PERL_TEST_DIR}/cpan/Digest-MD5/
31 cp -pv cpan/Digest-MD5/MD5.xs ${D}${PERL_TEST_DIR}/cpan/Digest-MD5/
32}
33
34FILES_${PN}-tests = "${PERL_TEST_DIR} \
35 ${libdir}/perl/${PV}/AnyDBM_File.t"
36RDEPENDS_${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 72efc638b2..99150422fe 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"
324require perl-rdepends_${PV}.inc 324require perl-rdepends_${PV}.inc
325require perl-rprovides.inc 325require perl-rprovides.inc
326require perl-rprovides_${PV}.inc 326require perl-rprovides_${PV}.inc
327include perl-tests.inc 327require perl-ptest.inc
328 328
329SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh" 329SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
330 330