[build] update build scripts and add multi-radio (TREL) CI build checks (#6518)

This commit updates `toranj/build.sh` script for posix based builds to
generate CLI executable. It also updates the posix platform to provide
log functionality when `LOG_OUTPUT` is set to `LOG_OUTPUT_APP`.

This commit also adds CI build checks for multi-radio and TREL build
configurations under posix platform.
This commit is contained in:
Abtin Keshavarzian
2021-04-29 09:28:07 -07:00
committed by GitHub
parent 84876d7f56
commit 91aaa34d9b
7 changed files with 48 additions and 16 deletions
+9
View File
@@ -42,6 +42,15 @@ build()
if [[ $OSTYPE != "darwin"* ]]; then
reset_source
make -f src/posix/Makefile-posix RCP_RESTORATION_MAX_COUNT=2 RCP_BUS=spi
reset_source
./tests/toranj/build.sh posix
reset_source
./tests/toranj/build.sh posix-15.4+trel
reset_source
./tests/toranj/build.sh posix-trel
fi
}
+7
View File
@@ -45,6 +45,13 @@ build()
)
"$(dirname "$0")"/cmake-build posix "${options[@]}"
options+=(
"-DOT_TREL=ON"
)
reset_source
"$(dirname "$0")"/cmake-build posix "${options[@]}"
}
main()
+4 -4
View File
@@ -109,12 +109,12 @@ static const char *BufferToString(const uint8_t *aBuffer, uint16_t aLength)
char * cur = &string[0];
char * end = &string[sizeof(string) - 1];
cur += snprintf(cur, end - cur, "[(len:%d) ", aLength);
cur += snprintf(cur, (uint16_t)(end - cur), "[(len:%d) ", aLength);
VerifyOrExit(cur < end);
while (aLength-- && (num < kMaxWrite))
{
cur += snprintf(cur, end - cur, "%02x ", *aBuffer++);
cur += snprintf(cur, (uint16_t)(end - cur), "%02x ", *aBuffer++);
VerifyOrExit(cur < end);
num++;
@@ -122,7 +122,7 @@ static const char *BufferToString(const uint8_t *aBuffer, uint16_t aLength)
if (aLength != 0)
{
cur += snprintf(cur, end - cur, "... ");
cur += snprintf(cur, (uint16_t)(end - cur), "... ");
VerifyOrExit(cur < end);
}
@@ -168,7 +168,7 @@ static void UpdateUnicastAddress(const otIp6Address *aUnicastAddress, bool aToAd
request.ifa.ifa_prefixlen = TREL_UNICAST_ADDRESS_PREFIX_LEN;
request.ifa.ifa_flags = IFA_F_NODAD;
request.ifa.ifa_scope = TREL_UNICAST_ADDRESS_SCOPE;
request.ifa.ifa_index = sInterfaceIndex;
request.ifa.ifa_index = (unsigned int)(sInterfaceIndex);
rta = reinterpret_cast<struct rtattr *>((reinterpret_cast<char *>(&request)) + NLMSG_ALIGN(request.nh.nlmsg_len));
rta->rta_type = IFA_LOCAL;
+12 -4
View File
@@ -100,6 +100,14 @@ configure_options=(
"--enable-ncp"
)
posix_configure_options=(
"--disable-docs"
"--enable-tests=$tests"
"--enable-coverage=$coverage"
"--enable-ftd"
"--enable-cli"
)
if [ -n "${top_builddir}" ]; then
top_srcdir=$(pwd)
mkdir -p "${top_builddir}"
@@ -202,7 +210,7 @@ case ${build_config} in
${top_srcdir}/configure \
CPPFLAGS="$cppflags_config" \
--with-platform=posix \
"${configure_options[@]}" || die
"${posix_configure_options[@]}" || die
make -j 8 || die
;;
@@ -218,7 +226,7 @@ case ${build_config} in
${top_srcdir}/configure \
CPPFLAGS="$cppflags_config" \
--with-platform=posix \
"${configure_options[@]}" || die
"${posix_configure_options[@]}" || die
make -j 8 || die
;;
@@ -234,7 +242,7 @@ case ${build_config} in
${top_srcdir}/configure \
CPPFLAGS="$cppflags_config" \
--with-platform=posix \
"${configure_options[@]}" || die
"${posix_configure_options[@]}" || die
make -j 8 || die
;;
@@ -250,7 +258,7 @@ case ${build_config} in
${top_srcdir}/configure \
CPPFLAGS="$cppflags_config" \
--with-platform=posix \
"${configure_options[@]}" || die
"${posix_configure_options[@]}" || die
make -j 8 || die
;;
@@ -45,6 +45,14 @@
*/
#define OPENTHREAD_CONFIG_PLATFORM_INFO "POSIX-toranj"
/**
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
*
* Selects if, and where the LOG output goes to.
*
*/
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
/**
* @def OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
*
@@ -59,4 +59,12 @@
*/
#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
*
* Selects if, and where the LOG output goes to.
*
*/
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP
#endif /* OPENTHREAD_CORE_TORANJ_CONFIG_SIMULATION_H_ */
@@ -256,14 +256,6 @@
*/
#define OPENTHREAD_CONFIG_MAC_FILTER_SIZE 80
/**
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
*
* Selects if, and where the LOG output goes to.
*
*/
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP
/**
* @def OPENTHREAD_CONFIG_LOG_LEVEL
*