summaryrefslogtreecommitdiffstats
path: root/meta/classes/ptest.bbclass
diff options
context:
space:
mode:
authorDouglas Royds <douglas.royds@taitradio.com>2018-11-28 04:53:09 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-03 12:20:01 (GMT)
commitd3d09bd064466e887e964fc460a1208882efc9de (patch)
tree3ca663d229acbd13c7ae464664d595b2d40cb3d1 /meta/classes/ptest.bbclass
parent5cd79e81471ca392bb697c2161526423b5a5dc07 (diff)
downloadpoky-d3d09bd064466e887e964fc460a1208882efc9de.tar.gz
ptest: Reproducibility: Strip build host paths from any installed Makefile
A common pattern for ptest is to install a Makefile that provides a make check target. These generated Makefiles are normally full of build host paths, to hosttools, and to files and scripts within the source or build tree. They also commonly include the CFLAGS and CPPFLAGS. None of these build host paths can possibly work on-target, so stripping them has no effect on the success of the resulting ptests. Stripping the HOSTTOOLS_DIR has this effect, for instance: -MKDIR_P = /home/douglas/workspace/upstream/build/tmp/hosttools/mkdir -p +MKDIR_P = mkdir -p The curious WORKDIR/*= pattern avoids non-parseable -fdebug-prefix-map patterns in the CFLAGS by adding an arbitrary ".", eg: -fdebug-prefix-map=.=/usr/src/debug/rsyslog/8.37.0-r0 In all other cases, we simply remove the WORKDIR, eg: CPP = arm-tait-linux-gnueabi-gcc -E --sysroot=recipe-sysroot ... (From OE-Core rev: 137e38dbae42e9d4d413cd2f9460fb707ca77f9c) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/ptest.bbclass')
-rw-r--r--meta/classes/ptest.bbclass13
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
index 9d8a798..fa518f6 100644
--- a/meta/classes/ptest.bbclass
+++ b/meta/classes/ptest.bbclass
@@ -3,6 +3,8 @@ DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION} \
3This package contains a test directory ${PTEST_PATH} for package test purposes." 3This package contains a test directory ${PTEST_PATH} for package test purposes."
4 4
5PTEST_PATH ?= "${libdir}/${BPN}/ptest" 5PTEST_PATH ?= "${libdir}/${BPN}/ptest"
6PTEST_BUILD_HOST_FILES ?= "Makefile"
7
6FILES_${PN}-ptest = "${PTEST_PATH}" 8FILES_${PN}-ptest = "${PTEST_PATH}"
7SECTION_${PN}-ptest = "devel" 9SECTION_${PN}-ptest = "devel"
8ALLOW_EMPTY_${PN}-ptest = "1" 10ALLOW_EMPTY_${PN}-ptest = "1"
@@ -45,6 +47,17 @@ do_install_ptest_base() {
45 fi 47 fi
46 do_install_ptest 48 do_install_ptest
47 chown -R root:root ${D}${PTEST_PATH} 49 chown -R root:root ${D}${PTEST_PATH}
50
51 # Strip build host paths from any installed Makefile
52 for filename in ${PTEST_BUILD_HOST_FILES}; do
53 for installed_ptest_file in $(find ${D}${PTEST_PATH} -type f -name $filename); do
54 bbnote "Stripping host paths from: $installed_ptest_file"
55 sed -e 's#${HOSTTOOLS_DIR}/*##g' \
56 -e 's#${WORKDIR}/*=#.=#g' \
57 -e 's#${WORKDIR}/*##g' \
58 -i $installed_ptest_file
59 done
60 done
48} 61}
49 62
50do_configure_ptest_base[dirs] = "${B}" 63do_configure_ptest_base[dirs] = "${B}"