There's no need to setup a fake 'source directory' and
redirect the tests to it; rather it's possible to point
them directly to ptest directory (this needs to be done
twice, in Makefile substitutions, and as a C define during
ptest compilation).
This also eliminates the assumption that S and B are in the
same directory (no longer true when S is in UNPACKDIR).
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
do_compile_ptest() {
cd ${B}/tests
sed -i '/^buildtest-TESTS: /c buildtest-TESTS: $(TESTS) $(check_LIBRARIES) $(check_PROGRAMS)' Makefile
- oe_runmake buildtest-TESTS
+ oe_runmake CPPFLAGS="-DSRCDIR=\\\"${PTEST_PATH}/tests/\\\"" buildtest-TESTS
}
do_install_ptest() {
chmod 0755 ${D}${PTEST_PATH}/tests/test-spawn-pipe-main \
${D}${PTEST_PATH}/tests/test-spawn-pipe-child ${D}${PTEST_PATH}/tests/test-version-etc \
${D}${PTEST_PATH}/tests/test-xalloc-die
-
- ln -sf ptest ${D}${libdir}/${BPN}/${BP}
- sed -i -e 's/@BP@/${BP}/g' ${D}${PTEST_PATH}/run-ptest
}
do_install_ptest:append:libc-glibc() {
#
#This script is used to run m4 test suites
cd tests
-make -k runtest-TESTS abs_aux_dir=../../@BP@/tests/build-aux abs_top_srcdir=../../@BP@/tests abs_srcdir=../../@BP@/tests top_srcdir=.. srcdir=.
+make -k runtest-TESTS abs_aux_dir=./build-aux abs_top_srcdir=. abs_srcdir=. top_srcdir=.. srcdir=.