mirror of
https://github.com/espressif/openthread.git
synced 2026-10-04 23:07:37 +00:00
[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:
+2
-2
@@ -182,11 +182,11 @@ jobs:
|
|||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
script: .travis/script.sh
|
script: .travis/script.sh
|
||||||
- env: BUILD_TARGET="toranj-test-framework" VERBOSE=1
|
- env: BUILD_TARGET="toranj-test-framework" COVERAGE=1 VERBOSE=1
|
||||||
os: linux
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
script: .travis/script.sh
|
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
|
os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
script: .travis/script.sh
|
script: .travis/script.sh
|
||||||
|
|||||||
+1
-1
@@ -637,7 +637,7 @@ build_samr21() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != toranj-test-framework ] || {
|
[ $BUILD_TARGET != toranj-test-framework ] || {
|
||||||
./tests/toranj/start.sh || die
|
top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh || die
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $BUILD_TARGET != osx ] || {
|
[ $BUILD_TARGET != osx ] || {
|
||||||
|
|||||||
+14
-3
@@ -91,13 +91,22 @@ configure_options=" \
|
|||||||
|
|
||||||
cppflags_config='-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"../tests/toranj/openthread-core-toranj-config.h\"'
|
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
|
case ${build_config} in
|
||||||
ncp)
|
ncp)
|
||||||
echo "==================================================================================================="
|
echo "==================================================================================================="
|
||||||
echo "Building OpenThread NCP FTD mode with POSIX platform"
|
echo "Building OpenThread NCP FTD mode with POSIX platform"
|
||||||
echo "==================================================================================================="
|
echo "==================================================================================================="
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
./configure \
|
cd "${top_builddir}"
|
||||||
|
${top_srcdir}/configure \
|
||||||
CPPFLAGS="$cppflags_config" \
|
CPPFLAGS="$cppflags_config" \
|
||||||
--with-examples=posix \
|
--with-examples=posix \
|
||||||
$configure_options || die
|
$configure_options || die
|
||||||
@@ -109,7 +118,8 @@ case ${build_config} in
|
|||||||
echo "Building OpenThread RCP (NCP in radio mode) with POSIX platform"
|
echo "Building OpenThread RCP (NCP in radio mode) with POSIX platform"
|
||||||
echo "===================================================================================================="
|
echo "===================================================================================================="
|
||||||
./bootstrap || die
|
./bootstrap || die
|
||||||
./configure \
|
cd "${top_builddir}"
|
||||||
|
${top_srcdir}/configure \
|
||||||
CPPFLAGS="$cppflags_config" \
|
CPPFLAGS="$cppflags_config" \
|
||||||
--enable-coverage=${coverage} \
|
--enable-coverage=${coverage} \
|
||||||
--enable-ncp \
|
--enable-ncp \
|
||||||
@@ -125,7 +135,8 @@ case ${build_config} in
|
|||||||
echo "Building OpenThread POSIX App NCP"
|
echo "Building OpenThread POSIX App NCP"
|
||||||
echo "===================================================================================================="
|
echo "===================================================================================================="
|
||||||
./bootstrap || die
|
./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" \
|
CPPFLAGS="$cppflags_config -DOPENTHREAD_CONFIG_POSIX_APP_ENABLE_PTY_DEVICE=1 -DOPENTHREAD_POSIX_RCP_UART_ENABLE=1" \
|
||||||
--enable-posix-app \
|
--enable-posix-app \
|
||||||
$configure_options || die
|
$configure_options || die
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ run() {
|
|||||||
|
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
|
|
||||||
# On Travis CI, the $BUILD_TARGET is defined as "toranj-test-framework".
|
if [ "$COVERAGE" = 1 ]; then
|
||||||
if [ "$BUILD_TARGET" = "toranj-test-framework" ]; then
|
|
||||||
coverage_option="--enable-coverage"
|
coverage_option="--enable-coverage"
|
||||||
else
|
else
|
||||||
coverage_option=""
|
coverage_option=""
|
||||||
|
|||||||
Reference in New Issue
Block a user