[toranj] improve code coverage by using absolute path (#4491)

Gcov sometimes cannot correctly find source files when the code is
configured with relative path. This commit enables using absolute path
to run toranj tests.
This commit is contained in:
Yakun Xu
2020-01-23 19:45:51 -08:00
committed by Jonathan Hui
parent b0a89c4083
commit 8d22fdd09c
4 changed files with 18 additions and 8 deletions
+2 -2
View File
@@ -182,11 +182,11 @@ jobs:
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1
- env: BUILD_TARGET="toranj-test-framework" COVERAGE=1 VERBOSE=1
os: linux
compiler: gcc
script: .travis/script.sh
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1 TORANJ_POSIX_APP_RCP_MODEL=1
- env: BUILD_TARGET="toranj-test-framework" COVERAGE=1 VERBOSE=1 TORANJ_POSIX_APP_RCP_MODEL=1
os: linux
compiler: gcc
script: .travis/script.sh
+1 -1
View File
@@ -637,7 +637,7 @@ build_samr21() {
}
[ $BUILD_TARGET != toranj-test-framework ] || {
./tests/toranj/start.sh || die
top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh || die
}
[ $BUILD_TARGET != osx ] || {
+14 -3
View File
@@ -91,13 +91,22 @@ configure_options=" \
cppflags_config='-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"../tests/toranj/openthread-core-toranj-config.h\"'
if [ -n "${top_builddir}" ]; then
top_srcdir=$(pwd)
mkdir -p "${top_builddir}"
else
top_srcdir=.
top_builddir=.
fi
case ${build_config} in
ncp)
echo "==================================================================================================="
echo "Building OpenThread NCP FTD mode with POSIX platform"
echo "==================================================================================================="
./bootstrap || die
./configure \
cd "${top_builddir}"
${top_srcdir}/configure \
CPPFLAGS="$cppflags_config" \
--with-examples=posix \
$configure_options || die
@@ -109,7 +118,8 @@ case ${build_config} in
echo "Building OpenThread RCP (NCP in radio mode) with POSIX platform"
echo "===================================================================================================="
./bootstrap || die
./configure \
cd "${top_builddir}"
${top_srcdir}/configure \
CPPFLAGS="$cppflags_config" \
--enable-coverage=${coverage} \
--enable-ncp \
@@ -125,7 +135,8 @@ case ${build_config} in
echo "Building OpenThread POSIX App NCP"
echo "===================================================================================================="
./bootstrap || die
./configure \
cd "${top_builddir}"
${top_srcdir}/configure \
CPPFLAGS="$cppflags_config -DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 -DOPENTHREAD_POSIX_RCP_UART_ENABLE=1" \
--enable-posix-app \
$configure_options || die
+1 -2
View File
@@ -77,8 +77,7 @@ run() {
cd $(dirname $0)
# On Travis CI, the $BUILD_TARGET is defined as "toranj-test-framework".
if [ "$BUILD_TARGET" = "toranj-test-framework" ]; then
if [ "$COVERAGE" = 1 ]; then
coverage_option="--enable-coverage"
else
coverage_option=""