Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
| 7 | inherit ptest |
| 8 | |
| 9 | FILESEXTRAPATHS:prepend := "${COREBASE}/meta/files:" |
| 10 | |
| 11 | SRC_URI += "file://ptest-perl/run-ptest" |
| 12 | |
| 13 | do_install_ptest_perl() { |
| 14 | install -d ${D}${PTEST_PATH} |
| 15 | if [ ! -f ${D}${PTEST_PATH}/run-ptest ]; then |
| 16 | install -m 0755 ${WORKDIR}/ptest-perl/run-ptest ${D}${PTEST_PATH} |
| 17 | fi |
| 18 | cp -r ${B}/t ${D}${PTEST_PATH} |
| 19 | chown -R root:root ${D}${PTEST_PATH} |
| 20 | } |
| 21 | |
| 22 | FILES:${PN}-ptest:prepend = "${PTEST_PATH}/t/* ${PTEST_PATH}/run-ptest " |
| 23 | |
| 24 | RDEPENDS:${PN}-ptest:prepend = "perl " |
| 25 | |
| 26 | addtask install_ptest_perl after do_install_ptest_base before do_package |
| 27 | |
| 28 | python () { |
| 29 | if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d): |
| 30 | d.setVarFlag('do_install_ptest_perl', 'fakeroot', '1') |
| 31 | |
| 32 | # Remove all '*ptest_perl' tasks when ptest is not enabled |
| 33 | if not(d.getVar('PTEST_ENABLED') == "1"): |
| 34 | for i in ['do_install_ptest_perl']: |
| 35 | bb.build.deltask(i, d) |
| 36 | } |