mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[continuous-integration] move android check to GitHub Actions (#4829)
This commit is contained in:
@@ -160,3 +160,11 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
script/check-simulation-build
|
||||
|
||||
android:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
docker run --rm -v $PWD:/build/openthread openthread/android-trusty /build/openthread/script/check-android-build
|
||||
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2016, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
language: python
|
||||
python: "3.6"
|
||||
|
||||
sudo: required
|
||||
dist: bionic
|
||||
|
||||
before_install:
|
||||
- travis_retry .travis/before_install.sh
|
||||
|
||||
before_script:
|
||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
||||
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6';
|
||||
fi
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- env: BUILD_TARGET="android-build" VERBOSE=1
|
||||
os: linux
|
||||
dist: trusty
|
||||
python: "2.7" # The old Android build system only supports python2
|
||||
script: .travis/script.sh
|
||||
- env: BUILD_TARGET="android-build" VERBOSE=1 USE_OTBR_DAEMON=1
|
||||
os: linux
|
||||
dist: trusty
|
||||
python: "2.7" # The old Android build system only supports python2
|
||||
script: .travis/script.sh
|
||||
@@ -1,189 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2016, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
[ -n "$BUILD_TARGET" ] || exit 0
|
||||
|
||||
die() {
|
||||
echo " *** ERROR: " $*
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
cd /tmp || die
|
||||
|
||||
[ $TRAVIS_OS_NAME != linux ] || {
|
||||
(cd /etc/apt/sources.list.d && sudo rm -rf cassandra.list* couchdb.list* mongodb-3.4.list* rabbitmq_rabbitmq-server.list* chris-lea-redis-server.list* github_git-lfs.list* pgdg.list)
|
||||
sudo apt-get update || die
|
||||
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
|
||||
pip3 install --upgrade pip
|
||||
pip3 install cmake
|
||||
|
||||
case "${BUILD_TARGET}" in
|
||||
simulation-distcheck|simulation-32-bit|posix-cli|simulation-mtd|simulation-ncp|posix-ncp|v1.2)
|
||||
pip install --upgrade pip || die
|
||||
pip install -r $TRAVIS_BUILD_DIR/tests/scripts/thread-cert/requirements.txt || die
|
||||
[ $BUILD_TARGET != simulation-ncp -a $BUILD_TARGET != posix-ncp ] || {
|
||||
# Packages used by ncp tools.
|
||||
pip install git+https://github.com/openthread/pyspinel || die
|
||||
}
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
[ $BUILD_TARGET != android-build ] || {
|
||||
sudo apt-get --no-install-recommends install -y bison gcc-multilib g++-multilib
|
||||
(
|
||||
cd $HOME
|
||||
wget https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip
|
||||
unzip android-ndk-r17c-linux-x86_64.zip > /dev/null
|
||||
mv android-ndk-r17c ndk-bundle
|
||||
) || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != gn-build ] || {
|
||||
# Install ninja
|
||||
(
|
||||
cd $HOME
|
||||
wget -O ninja.zip https://chrome-infra-packages.appspot.com/dl/infra/ninja/linux-amd64/+/latest
|
||||
unzip -o ninja.zip
|
||||
chmod a+x ninja && mkdir -p bin && mv -f ninja bin/ && export PATH=${HOME}/bin:$PATH
|
||||
ninja --version
|
||||
) || die
|
||||
|
||||
|
||||
# Get latest gn
|
||||
(
|
||||
cd $HOME
|
||||
wget -O gn.zip https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest
|
||||
unzip -o gn.zip
|
||||
chmod a+x gn && mv -f gn bin/
|
||||
gn --version
|
||||
) || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-pty ] || {
|
||||
sudo apt-get --no-install-recommends install -y socat expect || die
|
||||
JOBS=$(getconf _NPROCESSORS_ONLN)
|
||||
(
|
||||
LIBCOAP_TMPDIR=/tmp/libcoap
|
||||
mkdir $LIBCOAP_TMPDIR
|
||||
cd $LIBCOAP_TMPDIR
|
||||
wget https://github.com/obgm/libcoap/archive/bsd-licensed.tar.gz
|
||||
tar xvf bsd-licensed.tar.gz
|
||||
cd libcoap-bsd-licensed
|
||||
./autogen.sh
|
||||
./configure --prefix= --exec-prefix=/usr --with-boost=internal --disable-tests --disable-documentation
|
||||
make -j $JOBS
|
||||
sudo make install
|
||||
) || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-migrate ] || {
|
||||
sudo apt-get install expect || die
|
||||
sudo apt-get --no-install-recommends install -y expect || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-4 ] || {
|
||||
sudo apt-get --no-install-recommends install -y lib32z1 || die
|
||||
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-5 ] || {
|
||||
sudo apt-get --no-install-recommends install -y lib32z1 || die
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-6 ] || {
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-7 ] || {
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-8 ] || {
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-9 ] || {
|
||||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 || die
|
||||
tar xjf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 || die
|
||||
export PATH=/tmp/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH || die
|
||||
arm-none-eabi-gcc --version || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation-32-bit -a $BUILD_TARGET != simulation-mtd ] || {
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation-distcheck ] || {
|
||||
sudo apt-get --no-install-recommends install -y llvm-runtime || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != toranj-test-framework ] || {
|
||||
# packages for wpantund
|
||||
sudo apt-get --no-install-recommends install -y dbus || die
|
||||
sudo apt-get --no-install-recommends install -y gcc g++ libdbus-1-dev || die
|
||||
sudo apt-get --no-install-recommends install -y autoconf-archive || die
|
||||
sudo apt-get --no-install-recommends install -y bsdtar || die
|
||||
sudo apt-get --no-install-recommends install -y libtool || die
|
||||
sudo apt-get --no-install-recommends install -y libglib2.0-dev || die
|
||||
sudo apt-get --no-install-recommends install -y libboost-dev || die
|
||||
sudo apt-get --no-install-recommends install -y libboost-signals-dev || die
|
||||
|
||||
# clone and build wpantund
|
||||
git clone --depth=1 --branch=master https://github.com/openthread/wpantund.git
|
||||
cd wpantund || die
|
||||
./bootstrap.sh || die
|
||||
./configure || die
|
||||
sudo make -j 8 || die
|
||||
sudo make install || die
|
||||
cd .. || die
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2018, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# Run this command on parent directory of openthread
|
||||
#
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
#######################################
|
||||
# Prepare android build system
|
||||
# Globals:
|
||||
# None
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# None
|
||||
#######################################
|
||||
android_prepare_build_system()
|
||||
{
|
||||
# Android build system
|
||||
(mkdir build && cd build && git init && git pull --depth 1 https://android.googlesource.com/platform/build 2db32730e79cafcf13e1f898a7bee7f82b0449d6)
|
||||
ln -s build/core/main.mk Makefile
|
||||
|
||||
# Workarounds for java checking
|
||||
export ANDROID_JAVA_HOME=/usr/lib/jvm/java-8-oracle
|
||||
mkdir bin
|
||||
cat > bin/java <<EOF
|
||||
#!/bin/sh
|
||||
echo java version \"1.6\"
|
||||
EOF
|
||||
|
||||
cat > bin/javac <<EOF
|
||||
echo javac \"1.6\"
|
||||
EOF
|
||||
chmod a+x bin/java bin/javac
|
||||
export PATH=$(pwd)/bin:$PATH
|
||||
|
||||
# Files for building ndk
|
||||
mkdir -p system/core/include/arch/linux-arm
|
||||
touch system/core/include/arch/linux-arm/AndroidConfig.h
|
||||
|
||||
mkdir -p system/core/include/arch/linux-x86
|
||||
touch system/core/include/arch/linux-x86/AndroidConfig.h
|
||||
|
||||
ANDROID_NDK_PATH=$HOME/ndk-bundle
|
||||
mkdir -p bionic/libc/
|
||||
cp -r $ANDROID_NDK_PATH/sysroot/usr/include bionic/libc/include
|
||||
mv bionic/libc/include/arm-linux-androideabi/asm bionic/libc/include/asm
|
||||
|
||||
mkdir -p out/target/product/generic/obj/
|
||||
cp -r $ANDROID_NDK_PATH/platforms/android-27/arch-arm/usr/lib out/target/product/generic/obj/
|
||||
|
||||
mkdir -p bionic/libstdc++
|
||||
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/include bionic/libstdc++
|
||||
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include/* bionic/libstdc++/include
|
||||
# The default libstdc++.so does not contain full stl implementation, see https://developer.android.com/ndk/guides/cpp-support
|
||||
cp -r $ANDROID_NDK_PATH/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so out/target/product/generic/obj/lib/libstdc++.so
|
||||
|
||||
# Build spec
|
||||
cat > buildspec.mk <<EOF
|
||||
TARGET_PRODUCT := generic
|
||||
TARGET_BUILD_VARIANT := eng
|
||||
TARGET_BUILD_TYPE := release
|
||||
TARGET_TOOLS_PREFIX := $ANDROID_NDK_PATH/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
|
||||
EOF
|
||||
}
|
||||
|
||||
main() {
|
||||
android_prepare_build_system
|
||||
|
||||
make showcommands ot-cli
|
||||
test -x out/target/product/generic/system/bin/ot-cli
|
||||
|
||||
if test "${USE_OTBR_DAEMON}" = 1; then
|
||||
make showcommands ot-ctl
|
||||
test -x out/target/product/generic/system/bin/ot-ctl
|
||||
fi
|
||||
|
||||
make showcommands ot-ncp
|
||||
test -x out/target/product/generic/system/bin/ot-ncp
|
||||
|
||||
make showcommands spi-hdlc-adapter
|
||||
test -x out/target/product/generic/system/bin/spi-hdlc-adapter
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,704 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2016, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
die() {
|
||||
echo " *** ERROR: " $*
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
python --version || die
|
||||
|
||||
[ $BUILD_TARGET != scan-build ] || {
|
||||
./bootstrap || die
|
||||
|
||||
export CPPFLAGS="-DMBEDTLS_DEBUG_C"
|
||||
export CPPFLAGS="${CPPFLAGS} -I${TRAVIS_BUILD_DIR}/third_party/mbedtls"
|
||||
export CPPFLAGS="${CPPFLAGS} -I${TRAVIS_BUILD_DIR}/third_party/mbedtls/repo/include"
|
||||
export CPPFLAGS="${CPPFLAGS} -DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
|
||||
|
||||
# UART transport
|
||||
export CPPFLAGS="${CPPFLAGS} \
|
||||
-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1"
|
||||
|
||||
scan-build ./configure \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--enable-cli \
|
||||
--enable-executable=no \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--with-examples=simulation || die
|
||||
|
||||
scan-build --status-bugs -analyze-headers -v make -j2 || die
|
||||
|
||||
# SPI transport
|
||||
scan-build ./configure \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--enable-cli \
|
||||
--enable-executable=no \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--with-examples=simulation || die
|
||||
|
||||
scan-build --status-bugs -analyze-headers -v make -j2 || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != android-build ] || {
|
||||
(cd .. && ${TRAVIS_BUILD_DIR}/.travis/check-android-build) || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != gn-build ] || {
|
||||
(cd ${TRAVIS_BUILD_DIR} && .travis/check-gn-build) || die
|
||||
}
|
||||
|
||||
build_cc1352() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc1352 || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/cc1352/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_cc2538() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
mkdir build && cd build || die
|
||||
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=examples/platforms/cc2538/arm-none-eabi.cmake -DOT_PLATFORM=cc2538 -DOT_COMPILE_WARNING_AS_ERROR=ON .. || die
|
||||
ninja || die
|
||||
cd .. || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc2538 || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/cc2538/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_cc2650() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-cc2650 || die
|
||||
arm-none-eabi-size output/cc2650/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc2650/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_cc2652() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-cc2652 || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/cc2652/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_kw41z() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-kw41z || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/kw41z/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_nrf52811() {
|
||||
# Default OpenThread switches for nRF52811 platform
|
||||
OPENTHREAD_FLAGS="BORDER_ROUTER=1 COAP=1 DNS_CLIENT=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1"
|
||||
|
||||
# UART transport
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-nrf52811 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-rcp || die
|
||||
|
||||
# SPI transport for NCP
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
NCP_SPI=1 make -f examples/Makefile-nrf52811 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52811/bin/ot-rcp || die
|
||||
|
||||
# Build without transport (no CLI or NCP applications)
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52811 || die
|
||||
}
|
||||
|
||||
build_nrf52833() {
|
||||
# Default OpenThread switches for nRF52833 platform
|
||||
OPENTHREAD_FLAGS="BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COAPS=1 COMMISSIONER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 ECDSA=1 FULL_LOGS=1 IP6_FRAGM=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 SLAAC=1 SNTP_CLIENT=1 UDP_FORWARD=1"
|
||||
|
||||
# UART transport
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-nrf52833 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-rcp || die
|
||||
|
||||
# USB transport
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
USB=1 make -f examples/Makefile-nrf52833 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-rcp || die
|
||||
|
||||
# SPI transport for NCP
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
NCP_SPI=1 make -f examples/Makefile-nrf52833 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52833/bin/ot-rcp || die
|
||||
|
||||
# Build without transport (no CLI or NCP applications)
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52833 $OPENTHREAD_FLAGS || die
|
||||
}
|
||||
|
||||
build_nrf52840() {
|
||||
# Default OpenThread switches for nRF52840 platform
|
||||
OPENTHREAD_FLAGS="BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COAPS=1 COMMISSIONER=1 DEBUG=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 ECDSA=1 FULL_LOGS=1 IP6_FRAGM=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 SLAAC=1 SNTP_CLIENT=1 UDP_FORWARD=1"
|
||||
|
||||
# UART transport
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# USB transport with bootloader e.g. to support PCA10059 dongle
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
USB=1 BOOTLOADER=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# SPI transport for NCP
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
NCP_SPI=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# Build without transport (no CLI or NCP applications)
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_TRANSPORTS=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
|
||||
# Software cryptography
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_BUILTIN_MBEDTLS=0 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
|
||||
# Software cryptography with threading support
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
DISABLE_BUILTIN_MBEDTLS=0 MBEDTLS_THREADING=1 make -f examples/Makefile-nrf52840 $OPENTHREAD_FLAGS || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-ncp-mtd || die
|
||||
arm-none-eabi-size output/nrf52840/bin/ot-rcp || die
|
||||
}
|
||||
|
||||
build_qpg6095() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-qpg6095 || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/qpg6095/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
build_samr21() {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.45.0.85.zip || die
|
||||
unzip -qq asf-standalone-archive-3.45.0.85.zip || die
|
||||
mv xdk-asf-3.45.0 third_party/microchip/asf || die
|
||||
./bootstrap || die
|
||||
COMMISSIONER=1 JOINER=1 SLAAC=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 DNS_CLIENT=1 make -f examples/Makefile-samr21 || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-cli-ftd || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-cli-mtd || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-ncp-ftd || die
|
||||
arm-none-eabi-size output/samr21/bin/ot-ncp-mtd || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-4 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-5 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-5_4-2016q3/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-6 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-7 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-8 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-8-2018-q4-major/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != arm-gcc-9 ] || {
|
||||
export PATH=/tmp/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH || die
|
||||
|
||||
build_cc1352
|
||||
build_cc2538
|
||||
build_cc2650
|
||||
build_cc2652
|
||||
build_kw41z
|
||||
build_nrf52811
|
||||
build_nrf52833
|
||||
build_nrf52840
|
||||
build_qpg6095
|
||||
build_samr21
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation ] || {
|
||||
CMAKE_FLAGS=" \
|
||||
-DOT_COMPILE_WARNING_AS_ERROR=on \
|
||||
-DOT_BORDER_AGENT=on \
|
||||
-DOT_BORDER_ROUTER=on \
|
||||
-DOT_COAP=on \
|
||||
-DOT_COAPS=on \
|
||||
-DOT_COMMISSIONER=on \
|
||||
-DOT_CHANNEL_MANAGER=on \
|
||||
-DOT_CHANNEL_MONITOR=on \
|
||||
-DOT_CHILD_SUPERVISION=on \
|
||||
-DOT_DHCP6_CLIENT=on \
|
||||
-DOT_DHCP6_SERVER=on \
|
||||
-DOT_DIAGNOSTIC=on \
|
||||
-DOT_DNS_CLIENT=on \
|
||||
-DOT_ECDSA=on \
|
||||
-DOT_IP6_FRAGM=on \
|
||||
-DOT_JAM_DETECTION=on \
|
||||
-DOT_JOINER=on \
|
||||
-DOT_LINK_RAW=on \
|
||||
-DOT_MAC_FILTER=on \
|
||||
-DOT_MTD_NETDIAG=on \
|
||||
-DOT_SERVICE=on \
|
||||
-DOT_SLAAC=on \
|
||||
-DOT_SNTP_CLIENT=on"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
mkdir build && cd build || die
|
||||
cmake -GNinja -DOT_PLATFORM=simulation $CMAKE_FLAGS .. || die
|
||||
ninja || die
|
||||
cd .. || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./tests/toranj/build.sh cmake || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./tests/toranj/build.sh cmake-posix || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_NONE make -f examples/Makefile-simulation || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG make -f examples/Makefile-simulation || die
|
||||
|
||||
export CPPFLAGS=" \
|
||||
-DOPENTHREAD_CONFIG_ANNOUNCE_SENDER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MAC_BEACON_RSP_WHEN_JOINABLE_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE \
|
||||
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_SOFTWARE_ACK_TIMEOUT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_SOFTWARE_CSMA_BACKOFF_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_SOFTWARE_ENERGY_SCAN_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_SOFTWARE_RETRANSMIT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-simulation || die
|
||||
|
||||
export CPPFLAGS="${CPPFLAGS} \
|
||||
-DOPENTHREAD_CONFIG_ASSERT_ENABLE=0"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-simulation || die
|
||||
|
||||
export CPPFLAGS=" \
|
||||
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
CPPFLAGS=-DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1 make -f examples/Makefile-simulation || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
CPPFLAGS=-DOPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE=1 make -f examples/Makefile-simulation || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
./configure \
|
||||
--enable-ncp \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--with-examples=simulation \
|
||||
--disable-docs \
|
||||
--disable-tests \
|
||||
--with-vendor-extension=./src/core/common/extension_example.cpp || die
|
||||
make -j 8 || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
./configure \
|
||||
--enable-cli \
|
||||
--enable-mtd \
|
||||
--with-examples=simulation \
|
||||
--disable-docs \
|
||||
--disable-tests || die
|
||||
make -j 8 || die
|
||||
|
||||
export CPPFLAGS=" \
|
||||
-DOPENTHREAD_CONFIG_ANOUNCE_SENDER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
./configure \
|
||||
--enable-cli \
|
||||
--enable-ncp \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-radio-only \
|
||||
--with-examples=simulation || die
|
||||
make -j 8 || die
|
||||
|
||||
export CPPFLAGS=" \
|
||||
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
./configure \
|
||||
--enable-ncp \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--with-examples=simulation \
|
||||
--disable-docs \
|
||||
--disable-tests \
|
||||
--with-ncp-vendor-hook-source=./src/ncp/example_vendor_hook.cpp || die
|
||||
make -j 8 || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation-distcheck ] || {
|
||||
export ASAN_SYMBOLIZER_PATH=`which llvm-symbolizer` || die
|
||||
export ASAN_OPTIONS=symbolize=1 || die
|
||||
export DISTCHECK_CONFIGURE_FLAGS= CPPFLAGS=-DOPENTHREAD_SIMULATION_VIRTUAL_TIME=1 || die
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 make -f examples/Makefile-simulation distcheck || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation-32-bit ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make -f examples/Makefile-simulation check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-cli ] || {
|
||||
./bootstrap || die
|
||||
# enable code coverage for OpenThread transceiver only
|
||||
COVERAGE=1 VIRTUAL_TIME_UART=1 make -f examples/Makefile-simulation || die
|
||||
# readline supports pipe, editline does not
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 READLINE=readline make -f src/posix/Makefile-posix || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 OT_CLI_PATH="$(pwd)/$(ls output/posix/*/bin/ot-cli) -v" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" make -f src/posix/Makefile-posix check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != v1.2 ] || {
|
||||
./bootstrap || die
|
||||
./script/test build || die
|
||||
./script/test cert_suite tests/scripts/thread-cert/v1_2_* || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-pty ] || {
|
||||
# check daemon mode
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
mkdir build && cd build || die
|
||||
cmake -GNinja -DOT_PLATFORM=posix -DOT_DAEMON=ON -DCOMPILE_WARNING_AS_ERROR=ON .. || die
|
||||
ninja || die
|
||||
cd .. || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
mkdir build && cd build || die
|
||||
cmake -GNinja -DOT_PLATFORM=posix -DCOMPILE_WARNING_AS_ERROR=ON .. || die
|
||||
ninja || die
|
||||
cd .. || die
|
||||
|
||||
./bootstrap
|
||||
.travis/check-posix-pty || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-migrate ] || {
|
||||
./bootstrap
|
||||
.travis/check-ncp-rcp-migrate || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation-mtd ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 USE_MTD=1 make -f examples/Makefile-simulation check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation-ncp-spi ] || {
|
||||
CPPFLAGS="-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1"
|
||||
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-simulation check configure_OPTIONS="--enable-ncp --enable-ftd --with-examples=simulation" || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-ncp ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 VIRTUAL_TIME_UART=1 make -f examples/Makefile-simulation || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 READLINE=readline make -f src/posix/Makefile-posix || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 OT_NCP_PATH="$(pwd)/$(ls output/posix/*/bin/ot-ncp)" RADIO_DEVICE="$(pwd)/$(ls output/*/bin/ot-rcp)" NODE_TYPE=ncp-sim make -f src/posix/Makefile-posix check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != posix-spi ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 READLINE=readline RCP_SPI=1 make -f src/posix/Makefile-posix || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != simulation-ncp ] || {
|
||||
./bootstrap || die
|
||||
REFERENCE_DEVICE=1 COVERAGE=1 PYTHONUNBUFFERED=1 NODE_TYPE=ncp-simulation make -f examples/Makefile-simulation check || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != toranj-test-framework ] || {
|
||||
top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh || die
|
||||
}
|
||||
|
||||
[ $BUILD_TARGET != osx ] || {
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f examples/Makefile-simulation || die
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
./bootstrap || die
|
||||
make -f src/posix/Makefile-posix || die
|
||||
}
|
||||
@@ -37,7 +37,6 @@ The OpenThread Project follows the "Fork-and-Pull" model for accepting contribut
|
||||
Setup your GitHub fork and continuous-integration services:
|
||||
|
||||
1. Fork the [OpenThread repository](https://github.com/openthread/openthread) by clicking "Fork" on the web UI.
|
||||
2. Enable [Travis CI](https://travis-ci.org/) by logging in the respective service with your GitHub account and enabling your newly created fork. We use Travis CI for Linux-based continuous integration checks. All contributions must pass these checks to be accepted.
|
||||
|
||||
Setup your local development environment:
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[![OpenThread][ot-logo]][ot-repo]
|
||||
[![Build][ot-gh-action-build-svg]][ot-gh-action-build]
|
||||
[![Simulation][ot-gh-action-simulation-svg]][ot-gh-action-simulation]
|
||||
[![Build Status][ot-travis-svg]][ot-travis]
|
||||
[![Language grade: C/C++][ot-lgtm-svg]][ot-lgtm]
|
||||
[![Coverage Status][ot-codecov-svg]][ot-codecov]
|
||||
[![Build Status][ot-docker-dev-svg]][ot-docker-dev]
|
||||
@@ -30,8 +29,6 @@ More information about Thread can be found at [threadgroup.org](http://threadgro
|
||||
[ot-gh-action-build-svg]: https://github.com/openthread/openthread/workflows/Build/badge.svg?branch=master&event=push
|
||||
[ot-gh-action-simulation]: https://github.com/openthread/openthread/actions?query=workflow%3ASimulation+branch%3Amaster+event%3Apush
|
||||
[ot-gh-action-simulation-svg]: https://github.com/openthread/openthread/workflows/Simulation/badge.svg?branch=master&event=push
|
||||
[ot-travis]: https://travis-ci.org/openthread/openthread
|
||||
[ot-travis-svg]: https://travis-ci.org/openthread/openthread.svg?branch=master
|
||||
[ot-lgtm]: https://lgtm.com/projects/g/openthread/openthread/context:cpp
|
||||
[ot-lgtm-svg]: https://img.shields.io/lgtm/grade/cpp/g/openthread/openthread.svg?logo=lgtm&logoWidth=18
|
||||
[ot-codecov]: https://codecov.io/gh/openthread/openthread
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2019, The OpenThread Authors.
|
||||
# Copyright (c) 2018, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -27,26 +27,28 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
[ -n "$BUILD_TARGET" ] || exit 0
|
||||
#
|
||||
# Run this command on parent directory of openthread
|
||||
#
|
||||
|
||||
set -e
|
||||
set -euxo pipefail
|
||||
|
||||
codecov_upload() {
|
||||
curl -s https://codecov.io/bash > codecov
|
||||
chmod a+x codecov
|
||||
check_targets()
|
||||
{
|
||||
for target in "$@"; do
|
||||
make showcommands "${target}"
|
||||
test -x "out/target/product/generic/system/bin/${target}"
|
||||
done
|
||||
|
||||
# Assume gcov by default, and llvm-cov if CC is clang
|
||||
if [[ -z $CC ]]; then
|
||||
./codecov
|
||||
elif "$CC" --version | grep -q gcc; then
|
||||
./codecov
|
||||
elif "$CC" --version | grep -q clang; then
|
||||
./codecov -x "llvm-cov gcov"
|
||||
fi
|
||||
for target in "$@"; do
|
||||
make "clean-${target}" || true
|
||||
done
|
||||
}
|
||||
|
||||
main() {
|
||||
codecov_upload
|
||||
main()
|
||||
{
|
||||
USE_OTBR_DAEMON=1 check_targets ot-cli ot-ctl ot-ncp
|
||||
check_targets ot-cli ot-ncp spi-hdlc-adapter
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -135,7 +135,7 @@ EOF
|
||||
sudo killall -9 ot-ctl || true
|
||||
NETIF_INDEX=$(ip link show "${VALID_NETIF_NAME}" | cut -f 1 -d ":" | head -n 1)
|
||||
sudo PATH="$(dirname ${OT_CLI_CMD}):${PATH}" \
|
||||
python3 "$(pwd)/.travis/test_multicast_join.py" "${NETIF_INDEX}" \
|
||||
python3 "$PWD/tests/scripts/misc/test_multicast_join.py" "${NETIF_INDEX}" \
|
||||
|| die 'multicast group join failed'
|
||||
fi
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ from ipaddress import ip_address
|
||||
|
||||
|
||||
def get_maddrs():
|
||||
lines = subprocess.run(
|
||||
['ot-ctl', 'ipmaddr'], stdout=subprocess.PIPE).stdout.decode().split()
|
||||
lines = subprocess.run(['ot-ctl', 'ipmaddr'],
|
||||
stdout=subprocess.PIPE).stdout.decode().split()
|
||||
return [ip_address(l) for l in lines if l.startswith('ff')]
|
||||
|
||||
|
||||
@@ -47,21 +47,21 @@ def main():
|
||||
if_index = int(sys.argv[1])
|
||||
|
||||
with socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) as s:
|
||||
s.setsockopt(socket.IPPROTO_IPV6,
|
||||
socket.IPV6_MULTICAST_IF,
|
||||
if_index)
|
||||
s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP,
|
||||
struct.pack('16si', socket.inet_pton(socket.AF_INET6, group),
|
||||
if_index))
|
||||
s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_IF, if_index)
|
||||
s.setsockopt(
|
||||
socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP,
|
||||
struct.pack('16si', socket.inet_pton(socket.AF_INET6, group),
|
||||
if_index))
|
||||
time.sleep(2)
|
||||
maddrs = get_maddrs()
|
||||
print(maddrs)
|
||||
if not any(addr == ip_address(group) for addr in maddrs):
|
||||
return -1
|
||||
|
||||
s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_LEAVE_GROUP,
|
||||
struct.pack('16si', socket.inet_pton(socket.AF_INET6, group),
|
||||
if_index))
|
||||
s.setsockopt(
|
||||
socket.IPPROTO_IPV6, socket.IPV6_LEAVE_GROUP,
|
||||
struct.pack('16si', socket.inet_pton(socket.AF_INET6, group),
|
||||
if_index))
|
||||
|
||||
time.sleep(2)
|
||||
maddrs = get_maddrs()
|
||||
@@ -7,14 +7,14 @@
|
||||
- It allows testing of network interactions between many nodes (IPv6 traffic exchanges).
|
||||
|
||||
`toranj` is developed in Python. `toranj` runs wpantund natively with OpenThread in NCP mode on POSIX simulation platform.
|
||||
`toranj` tests will run as part of travis pull request validation in OpenThread and/or `wpantund` GitHub projects.
|
||||
`toranj` tests will run as part of GitHub Actions pull request validation in OpenThread and/or `wpantund` GitHub projects.
|
||||
|
||||
|
||||
## Setup
|
||||
|
||||
`toranj` requires `wpantund` to be installed.
|
||||
- Please follow [`wpantund` installation guide](https://github.com/openthread/wpantund/blob/master/INSTALL.md#wpantund-installation-guide). Note that `toranj` expects `wpantund` installed from latest master branch.
|
||||
- Alternative way to install `wpantund` is to use the same commands from travis `before_install` [script](https://github.com/openthread/openthread/blob/ef940b06594b370176b724733dbd7ad09617a693/.travis/before_install.sh#L110-L127) for build target `toranj-test-framework`.
|
||||
- Alternative way to install `wpantund` is to use the same commands from git workflow [Simulation](https://github.com/openthread/openthread/blob/4b55284bd20f99a88e8e2c617ba358a0a5547f5d/.github/workflows/simulation.yml#L336-L341) for build target `toranj-test-framework`.
|
||||
|
||||
To run all tests, `start` script can be used. This script will build OpenThread with proper configuration options and starts running all test.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user