Newbie here, trying to learn and setup Yocto to build and run unit tests for my recipe that fetches code from FooImpl but getting errors and unable to understand the root cause. So my recipe file is foo-impl-git.bb and the contents are
SUMMARY = "FooImpl"
DESCRIPTION = "FooImpl Recipe"
LICENSE = "CLOSED"
DEPENDS = "foo-interface googletest"
SRC_URI = "xxx/FooImpl;protocol=ssh;branch=mainline; \
file://run-ptest \
"
SRCREV = "yyyyy"
S = "${WORKDIR}/git"
inherit cmake ptest
do_install_ptest() {
mkdir -p ${D}${PTEST_PATH}/tests
cp -rf ${B}/test/foo-impl-unittest ${D}${PTEST_PATH}/tests
}
IMAGE_INSTALL:append = "foo-impl-ptest"
The error i am getting is
buildfarm-ssh] NOTE: recipe foo-impl-git-r0: task do_install_ptest_base: Started
[buildfarm-ssh] ERROR: foo-impl-git-r0 do_install_ptest_base: ExecutionError('zzz/tmp/work/core2-64-poky-linux/foo-impl/git-r0/temp/run.do_install_ptest_base.23883', 1, None, None)
[buildfarm-ssh] ERROR: Logfile of failure stored in: zzz/tmp/work/core2-64-poky-linux/foo-impl/git-r0/temp/log.do_install_ptest_base.23883
[buildfarm-ssh] Log data follows:
| DEBUG: Executing shell function do_install_ptest_base
| grep: Makefile: No such file or directory
| cp: cannot stat 'zzz/tmp/work/core2-64-poky-linux/foo/git-r0/foo-impl-git//test/foo-impl-unittest': No such file or directory
my run-ptest file is as follows
#!/bin/sh
tests/foo-impl-unittest
if [ $? -eq 0 ]; then
echo "PASS: $i"
else
echo "FAIL: $i"
fi
I have some clarifications
*) in do_install_ptest is foo-impl-unittest
arbitrary , if not what the correct naming conventions.
*) in IMAGE_INSTALL:append = "foo-impl-ptest"
is foo-impl-ptest arbitary. if not what the correct naming conventions.
*) in run-ptest file is tests/foo-impl-unittest
arbitatry.if not what the correct naming conventions.
I must admit that i found another recipe that was setting up ptest and tried to replicate it for my own recipe but clearly i am doing something wrong and do not understand the bigger picture. Would be great if i can get some answers to my questions and feedback/insights as to what i am missing here.
FooImpl package has the following directory structure
- src
- test
- FooTest.cpp
- CmakeLists.txt
- CMakeLists.txt
- Foo.cpp
- test
- CMakeLists.txt
- .gitignore