aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes
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:13:58 -0800
commitaeffa15350252489c62cd221b2e0548043fec548 (patch)
tree32e5272bd7e9805225a2a3502003a6a4fa130921 /meta/classes
parent8d6869a0a89d8cf3c6e57723fab2750ba2c885db (diff)
downloadopenembedded-core-contrib-aeffa15350252489c62cd221b2e0548043fec548.tar.gz
meta/classes: add ptest-perl.bbclass
* Enable easier testing of perl modules - Installs t/* to PTEST_PATH - Uses common run-ptest script 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')
-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 @@
+inherit ptest
+
+FILESEXTRAPATHS_prepend := "${COREBASE}/meta/files:"
+
+SRC_URI += "file://ptest-perl/run-ptest"
+
+do_install_ptest_perl() {
+ install -d ${D}${PTEST_PATH}
+ if [ ! -f ${D}${PTEST_PATH}/run-ptest ]; then
+ install -m 0755 ${WORKDIR}/ptest-perl/run-ptest ${D}${PTEST_PATH}
+ fi
+ cp -r ${B}/t ${D}${PTEST_PATH}
+ chown -R root:root ${D}${PTEST_PATH}
+}
+
+FILES_${PN}-ptest_prepend = "${PTEST_PATH}/t/* ${PTEST_PATH}/run-ptest "
+
+RDEPENDS_${PN}-ptest_prepend = "perl "
+
+addtask install_ptest_perl after do_install_ptest_base before do_package
+
+python () {
+ if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+ d.setVarFlag('do_install_ptest_perl', 'fakeroot', '1')
+
+ # Remove all '*ptest_perl' tasks when ptest is not enabled
+ if not(d.getVar('PTEST_ENABLED') == "1"):
+ for i in ['do_install_ptest_perl']:
+ bb.build.deltask(i, d)
+}