summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/ptest-perl.bbclass
blob: a4a9d40d52dfa78f2bd78913c538818cf5fa1a0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#

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 ${UNPACKDIR}/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)
}