2014-12-31 18:32:25 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# useful script to test all the different build types that we support.
|
|
|
|
# This helps when doing large merges
|
|
|
|
# Andrew Tridgell, November 2011
|
|
|
|
|
2015-04-05 16:24:54 -03:00
|
|
|
. ~/.profile
|
|
|
|
|
2017-07-17 11:03:30 -03:00
|
|
|
set -ex
|
|
|
|
|
2016-01-07 12:11:34 -04:00
|
|
|
# CXX and CC are exported by default by travis
|
2016-03-08 20:52:33 -04:00
|
|
|
c_compiler=${CC:-gcc}
|
|
|
|
cxx_compiler=${CXX:-g++}
|
2016-01-07 12:11:34 -04:00
|
|
|
unset CXX CC
|
|
|
|
|
2016-04-15 11:53:10 -03:00
|
|
|
export BUILDROOT=/tmp/ci.build
|
2016-01-18 21:28:04 -04:00
|
|
|
rm -rf $BUILDROOT
|
2016-04-15 11:53:10 -03:00
|
|
|
export GIT_VERSION="ci_test"
|
2018-06-12 00:33:42 -03:00
|
|
|
export CHIBIOS_GIT_VERSION="ci_test"
|
2016-04-15 11:53:10 -03:00
|
|
|
export CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
|
2018-09-19 13:03:45 -03:00
|
|
|
autotest_args=""
|
2016-01-18 21:28:04 -04:00
|
|
|
|
2016-05-11 17:09:43 -03:00
|
|
|
# If CI_BUILD_TARGET is not set, build 3 different ones
|
2016-01-18 15:37:53 -04:00
|
|
|
if [ -z "$CI_BUILD_TARGET" ]; then
|
2019-02-26 12:21:24 -04:00
|
|
|
CI_BUILD_TARGET="sitl linux fmuv3"
|
2015-06-15 22:03:23 -03:00
|
|
|
fi
|
2015-06-11 19:56:15 -03:00
|
|
|
|
2015-12-07 14:33:25 -04:00
|
|
|
waf=modules/waf/waf-light
|
|
|
|
|
2016-01-18 15:37:53 -04:00
|
|
|
echo "Targets: $CI_BUILD_TARGET"
|
2018-09-19 13:03:45 -03:00
|
|
|
echo "Compiler: $c_compiler"
|
|
|
|
|
2018-10-03 02:20:17 -03:00
|
|
|
pymavlink_installed=0
|
2019-11-06 01:16:46 -04:00
|
|
|
mavproxy_installed=0
|
2018-09-19 13:03:45 -03:00
|
|
|
|
2018-10-03 02:20:17 -03:00
|
|
|
function run_autotest() {
|
|
|
|
NAME="$1"
|
|
|
|
BVEHICLE="$2"
|
|
|
|
RVEHICLE="$3"
|
|
|
|
|
2020-10-14 02:18:10 -03:00
|
|
|
# report on what cpu's we have for later log review if needed
|
|
|
|
cat /proc/cpuinfo
|
|
|
|
|
2019-11-06 01:16:46 -04:00
|
|
|
if [ $mavproxy_installed -eq 0 ]; then
|
|
|
|
echo "Installing MAVProxy"
|
|
|
|
pushd /tmp
|
|
|
|
git clone --recursive https://github.com/ardupilot/MAVProxy
|
|
|
|
pushd MAVProxy
|
|
|
|
python setup.py build install --user --force
|
|
|
|
popd
|
|
|
|
popd
|
|
|
|
mavproxy_installed=1
|
|
|
|
# now uninstall the version of pymavlink pulled in by MAVProxy deps:
|
2020-09-03 05:01:16 -03:00
|
|
|
python -m pip uninstall -y pymavlink
|
2019-11-06 01:16:46 -04:00
|
|
|
fi
|
2018-10-04 05:44:12 -03:00
|
|
|
if [ $pymavlink_installed -eq 0 ]; then
|
2018-01-22 21:33:52 -04:00
|
|
|
echo "Installing pymavlink"
|
2019-11-05 22:56:11 -04:00
|
|
|
git submodule update --init --recursive
|
2018-01-22 21:33:52 -04:00
|
|
|
(cd modules/mavlink/pymavlink && python setup.py build install --user)
|
2018-10-03 02:20:17 -03:00
|
|
|
pymavlink_installed=1
|
|
|
|
fi
|
|
|
|
unset BUILDROOT
|
|
|
|
echo "Running SITL $NAME test"
|
|
|
|
|
2018-10-09 07:06:36 -03:00
|
|
|
w=""
|
2018-10-03 02:20:17 -03:00
|
|
|
if [ $c_compiler == "clang" ]; then
|
2018-10-09 07:06:36 -03:00
|
|
|
w="$w --check-c-compiler=clang --check-cxx-compiler=clang++"
|
|
|
|
fi
|
|
|
|
if [ $NAME == "Rover" ]; then
|
|
|
|
w="$w --enable-math-check-indexes"
|
2018-10-03 02:20:17 -03:00
|
|
|
fi
|
2019-09-04 18:55:39 -03:00
|
|
|
if [ "x$CI_BUILD_DEBUG" != "x" ]; then
|
|
|
|
w="$w --debug"
|
|
|
|
fi
|
2019-12-28 06:14:33 -04:00
|
|
|
Tools/autotest/autotest.py --show-test-timings --waf-configure-args="$w" "$BVEHICLE" "$RVEHICLE"
|
2018-10-03 02:20:17 -03:00
|
|
|
ccache -s && ccache -z
|
|
|
|
}
|
|
|
|
|
|
|
|
for t in $CI_BUILD_TARGET; do
|
|
|
|
# special case for SITL testing in CI
|
2020-05-29 00:30:01 -03:00
|
|
|
if [ "$t" == "sitltest-heli" ]; then
|
|
|
|
run_autotest "Heli" "build.Helicopter" "test.Helicopter"
|
|
|
|
continue
|
|
|
|
fi
|
2020-10-14 02:18:10 -03:00
|
|
|
# travis-ci
|
2020-02-21 21:32:43 -04:00
|
|
|
if [ "$t" == "sitltest-copter-tests1" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests1"
|
2018-01-22 21:33:52 -04:00
|
|
|
continue
|
|
|
|
fi
|
2020-10-14 02:18:10 -03:00
|
|
|
#github actions ci
|
|
|
|
if [ "$t" == "sitltest-copter-tests1a" ]; then
|
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests1a"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$t" == "sitltest-copter-tests1b" ]; then
|
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests1b"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$t" == "sitltest-copter-tests1c" ]; then
|
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests1c"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$t" == "sitltest-copter-tests1d" ]; then
|
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests1d"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$t" == "sitltest-copter-tests1e" ]; then
|
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests1e"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
# travis-ci
|
2020-02-21 21:32:43 -04:00
|
|
|
if [ "$t" == "sitltest-copter-tests2" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests2"
|
2020-02-21 18:27:18 -04:00
|
|
|
continue
|
|
|
|
fi
|
2020-10-14 02:18:10 -03:00
|
|
|
#github actions ci
|
|
|
|
if [ "$t" == "sitltest-copter-tests2a" ]; then
|
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests2a"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$t" == "sitltest-copter-tests2b" ]; then
|
|
|
|
run_autotest "Copter" "build.Copter" "test.CopterTests2b"
|
|
|
|
continue
|
|
|
|
fi
|
2020-09-29 15:54:02 -03:00
|
|
|
if [ "$t" == "sitltest-can" ]; then
|
|
|
|
echo "Building navigator"
|
|
|
|
$waf configure --board sitl
|
|
|
|
$waf copter
|
|
|
|
run_autotest "Copter" "build.SITLPeriphGPS" "test.CAN"
|
|
|
|
continue
|
|
|
|
fi
|
2018-10-04 05:54:17 -03:00
|
|
|
if [ "$t" == "sitltest-plane" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "Plane" "build.Plane" "test.Plane"
|
2018-04-10 19:43:39 -03:00
|
|
|
continue
|
|
|
|
fi
|
2018-10-04 05:54:17 -03:00
|
|
|
if [ "$t" == "sitltest-quadplane" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "QuadPlane" "build.Plane" "test.QuadPlane"
|
2018-01-22 21:33:52 -04:00
|
|
|
continue
|
|
|
|
fi
|
2018-10-04 05:54:17 -03:00
|
|
|
if [ "$t" == "sitltest-rover" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "Rover" "build.Rover" "test.Rover"
|
2018-01-22 21:33:52 -04:00
|
|
|
continue
|
|
|
|
fi
|
2020-02-18 20:31:48 -04:00
|
|
|
if [ "$t" == "sitltest-tracker" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "Tracker" "build.Tracker" "test.Tracker"
|
2020-02-18 20:31:48 -04:00
|
|
|
continue
|
|
|
|
fi
|
2019-09-17 18:09:33 -03:00
|
|
|
if [ "$t" == "sitltest-balancebot" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "BalanceBot" "build.Rover" "test.BalanceBot"
|
2019-09-17 18:09:33 -03:00
|
|
|
continue
|
|
|
|
fi
|
2018-10-23 14:55:58 -03:00
|
|
|
if [ "$t" == "sitltest-sub" ]; then
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "Sub" "build.Sub" "test.Sub"
|
2018-10-23 14:55:58 -03:00
|
|
|
continue
|
|
|
|
fi
|
2018-01-22 21:33:52 -04:00
|
|
|
|
2019-09-23 23:55:51 -03:00
|
|
|
if [ "$t" == "unit-tests" ]; then
|
|
|
|
run_autotest "Unit Tests" "build.unit_tests" "run.unit_tests"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2018-10-04 05:54:17 -03:00
|
|
|
if [ "$t" == "revo-bootloader" ]; then
|
2018-06-22 23:06:15 -03:00
|
|
|
echo "Building revo bootloader"
|
|
|
|
$waf configure --board revo-mini --bootloader
|
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
|
|
|
continue
|
|
|
|
fi
|
2018-06-23 18:43:24 -03:00
|
|
|
|
2019-07-31 22:25:43 -03:00
|
|
|
if [ "$t" == "periph-build" ]; then
|
|
|
|
echo "Building f103 bootloader"
|
2019-10-02 08:55:41 -03:00
|
|
|
$waf configure --board f103-GPS --bootloader
|
2019-07-31 22:25:43 -03:00
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
|
|
|
echo "Building f103 peripheral fw"
|
2019-10-02 08:55:41 -03:00
|
|
|
$waf configure --board f103-GPS
|
2019-07-31 22:25:43 -03:00
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
2019-10-31 08:02:29 -03:00
|
|
|
echo "Building f303 bootloader"
|
2020-01-24 20:01:14 -04:00
|
|
|
$waf configure --board f303-Universal --bootloader
|
2019-10-31 08:02:29 -03:00
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
|
|
|
echo "Building f303 peripheral fw"
|
2020-01-24 20:01:14 -04:00
|
|
|
$waf configure --board f303-Universal
|
2019-10-31 08:02:29 -03:00
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
2019-07-31 22:25:43 -03:00
|
|
|
continue
|
|
|
|
fi
|
2020-08-25 14:03:37 -03:00
|
|
|
|
2019-06-18 19:19:11 -03:00
|
|
|
if [ "$t" == "CubeOrange-bootloader" ]; then
|
|
|
|
echo "Building CubeOrange bootloader"
|
|
|
|
$waf configure --board CubeOrange --bootloader
|
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2019-03-10 07:31:03 -03:00
|
|
|
if [ "$t" == "stm32f7" ]; then
|
|
|
|
echo "Building mRoX21-777/"
|
2020-08-17 22:49:07 -03:00
|
|
|
$waf configure --Werror --board mRoX21-777
|
2019-03-10 07:31:03 -03:00
|
|
|
$waf clean
|
|
|
|
$waf plane
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$t" == "stm32h7" ]; then
|
2019-07-31 23:57:10 -03:00
|
|
|
echo "Building Durandal"
|
|
|
|
$waf configure --board Durandal
|
2019-03-10 07:31:03 -03:00
|
|
|
$waf clean
|
|
|
|
$waf copter
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2019-04-07 19:01:01 -03:00
|
|
|
if [ "$t" == "fmuv2-plane" ]; then
|
|
|
|
echo "Building fmuv2 plane"
|
|
|
|
$waf configure --board fmuv2
|
|
|
|
$waf clean
|
|
|
|
$waf plane
|
|
|
|
continue
|
|
|
|
fi
|
2020-08-25 14:03:37 -03:00
|
|
|
|
2018-10-04 05:54:17 -03:00
|
|
|
if [ "$t" == "iofirmware" ]; then
|
2018-09-14 07:12:01 -03:00
|
|
|
echo "Building iofirmware"
|
|
|
|
$waf configure --board iomcu
|
|
|
|
$waf clean
|
|
|
|
$waf iofirmware
|
|
|
|
continue
|
2020-08-25 14:02:06 -03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$t" == "navigator" ]; then
|
|
|
|
echo "Building navigator"
|
|
|
|
$waf configure --board navigator --toolchain=arm-linux-musleabihf
|
|
|
|
$waf sub --static
|
|
|
|
continue
|
2018-09-14 07:12:01 -03:00
|
|
|
fi
|
2020-11-07 04:32:00 -04:00
|
|
|
|
|
|
|
if [ "$t" == "replay" ]; then
|
|
|
|
echo "Building replay"
|
|
|
|
$waf configure --board linux --disable-scripting
|
|
|
|
$way --target tools/Replay
|
|
|
|
echo "Building AP_DAL standalone test"
|
|
|
|
$waf configure --board linux --disable-scripting --disable-gcs
|
2020-11-07 07:15:23 -04:00
|
|
|
$way --target tools/AP_DAL_Standalone
|
2020-11-07 04:32:00 -04:00
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
|
|
|
continue
|
|
|
|
fi
|
2019-01-05 10:22:11 -04:00
|
|
|
|
2019-03-14 19:36:24 -03:00
|
|
|
if [ "$t" == "configure-all" ]; then
|
|
|
|
echo "Checking configure of all boards"
|
|
|
|
./Tools/scripts/configure_all.py
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2020-02-06 15:16:01 -04:00
|
|
|
if [[ -z ${CI_CRON_JOB+1} ]]; then
|
2015-11-27 14:50:45 -04:00
|
|
|
echo "Starting waf build for board ${t}..."
|
2018-10-04 05:54:17 -03:00
|
|
|
$waf configure --board "$t" \
|
2018-03-28 01:04:48 -03:00
|
|
|
--enable-benchmarks \
|
|
|
|
--enable-header-checks \
|
|
|
|
--check-c-compiler="$c_compiler" \
|
|
|
|
--check-cxx-compiler="$cxx_compiler"
|
2015-12-07 14:33:25 -04:00
|
|
|
$waf clean
|
2016-05-17 11:39:24 -03:00
|
|
|
$waf all
|
2016-05-17 02:16:42 -03:00
|
|
|
ccache -s && ccache -z
|
|
|
|
|
2020-09-06 21:32:40 -03:00
|
|
|
if [[ $t == "linux" ]]; then
|
2016-01-19 09:02:10 -04:00
|
|
|
$waf check
|
|
|
|
fi
|
2020-09-06 21:32:40 -03:00
|
|
|
continue
|
2015-11-27 14:50:45 -04:00
|
|
|
fi
|
2014-12-31 18:32:25 -04:00
|
|
|
done
|
2016-01-19 16:41:18 -04:00
|
|
|
|
2020-03-26 21:51:16 -03:00
|
|
|
python Tools/autotest/param_metadata/param_parse.py --vehicle Rover
|
2019-07-18 18:23:42 -03:00
|
|
|
python Tools/autotest/param_metadata/param_parse.py --vehicle AntennaTracker
|
|
|
|
python Tools/autotest/param_metadata/param_parse.py --vehicle ArduCopter
|
|
|
|
python Tools/autotest/param_metadata/param_parse.py --vehicle ArduPlane
|
|
|
|
python Tools/autotest/param_metadata/param_parse.py --vehicle ArduSub
|
2018-06-01 22:56:07 -03:00
|
|
|
|
2016-01-19 16:41:18 -04:00
|
|
|
echo build OK
|
|
|
|
exit 0
|