summaryrefslogtreecommitdiffstats
path: root/meta/classes/ptest-perl.bbclass
diff options
context:
space:
mode:
authorTim Orling <timothy.t.orling@linux.intel.com>2018-03-04 04:41:49 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-06 06:19:18 -0800
commitd41bcbdebfbb4356a6b0388cf3c660dbd5ef9065 (patch)
tree5914fcdd75001611425e1940a90ce7b15365f01e /meta/classes/ptest-perl.bbclass
parentdc7ec9b8e0d4fc692184ec2827a28a32457cdc6f (diff)
downloadpoky-d41bcbdebfbb4356a6b0388cf3c660dbd5ef9065.tar.gz
meta/classes: add ptest-perl.bbclass
* Enable easier testing of perl modules - Installs t/* to PTEST_PATH - Uses common run-ptest script (From OE-Core rev: aeffa15350252489c62cd221b2e0548043fec548) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/ptest-perl.bbclass')
-rw-r--r--meta/classes/ptest-perl.bbclass30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/classes/ptest-perl.bbclass b/meta/classes/ptest-perl.bbclass
new file mode 100644
index 0000000000..a4bc40b51a
--- /dev/null
+++ b/meta/classes/ptest-perl.bbclass
@@ -0,0 +1,30 @@
1inherit ptest
2
3FILESEXTRAPATHS_prepend := "${COREBASE}/meta/files:"
4
5SRC_URI += "file://ptest-perl/run-ptest"
6
7do_install_ptest_perl() {
8 install -d ${D}${PTEST_PATH}
9 if [ ! -f ${D}${PTEST_PATH}/run-ptest ]; then
10 install -m 0755 ${WORKDIR}/ptest-perl/run-ptest ${D}${PTEST_PATH}
11 fi
12 cp -r ${B}/t ${D}${PTEST_PATH}
13 chown -R root:root ${D}${PTEST_PATH}
14}
15
16FILES_${PN}-ptest_prepend = "${PTEST_PATH}/t/* ${PTEST_PATH}/run-ptest "
17
18RDEPENDS_${PN}-ptest_prepend = "perl "
19
20addtask install_ptest_perl after do_install_ptest_base before do_package
21
22python () {
23 if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
24 d.setVarFlag('do_install_ptest_perl', 'fakeroot', '1')
25
26 # Remove all '*ptest_perl' tasks when ptest is not enabled
27 if not(d.getVar('PTEST_ENABLED') == "1"):
28 for i in ['do_install_ptest_perl']:
29 bb.build.deltask(i, d)
30}