2023-12-04 05:55:08 -04:00
|
|
|
#!/usr/bin/env bash
|
2014-12-31 18:32:25 -04:00
|
|
|
# useful script to test all the different build types that we support.
|
|
|
|
# This helps when doing large merges
|
|
|
|
# Andrew Tridgell, November 2011
|
|
|
|
|
2022-08-13 04:16:50 -03:00
|
|
|
XOLDPWD=$PWD # profile changes directory :-(
|
|
|
|
|
2015-04-05 16:24:54 -03:00
|
|
|
. ~/.profile
|
|
|
|
|
2022-08-13 04:16:50 -03:00
|
|
|
cd $XOLDPWD
|
|
|
|
|
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
|
|
|
|
2016-04-15 11:53:10 -03:00
|
|
|
export BUILDROOT=/tmp/ci.build
|
2016-01-18 21:28:04 -04:00
|
|
|
rm -rf $BUILDROOT
|
2022-01-15 22:22:55 -04:00
|
|
|
export GIT_VERSION="abcdef"
|
2022-04-09 11:31:28 -03:00
|
|
|
export GIT_VERSION_INT="15"
|
2022-01-15 22:22:55 -04:00
|
|
|
export CHIBIOS_GIT_VERSION="12345667"
|
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
|
|
|
|
2021-05-20 05:18:52 -03:00
|
|
|
# If CI_BUILD_TARGET is not set, build 4 different ones
|
2016-01-18 15:37:53 -04:00
|
|
|
if [ -z "$CI_BUILD_TARGET" ]; then
|
2021-05-20 05:18:52 -03:00
|
|
|
CI_BUILD_TARGET="sitl linux fmuv3 omnibusf4pro-one"
|
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
|
|
|
|
2022-07-19 09:22:05 -03:00
|
|
|
function install_pymavlink() {
|
|
|
|
if [ $pymavlink_installed -eq 0 ]; then
|
|
|
|
echo "Installing pymavlink"
|
2023-02-08 18:34:09 -04:00
|
|
|
git submodule update --init --recursive --depth 1
|
2022-07-19 09:22:05 -03:00
|
|
|
(cd modules/mavlink/pymavlink && python setup.py build install --user)
|
|
|
|
pymavlink_installed=1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-03-08 21:55:00 -04:00
|
|
|
function install_mavproxy() {
|
2019-11-06 01:16:46 -04:00
|
|
|
if [ $mavproxy_installed -eq 0 ]; then
|
|
|
|
echo "Installing MAVProxy"
|
|
|
|
pushd /tmp
|
2023-02-08 18:34:09 -04:00
|
|
|
git clone https://github.com/ardupilot/MAVProxy --depth 1
|
2019-11-06 01:16:46 -04:00
|
|
|
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
|
2023-03-08 21:55:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
function run_autotest() {
|
|
|
|
NAME="$1"
|
|
|
|
BVEHICLE="$2"
|
|
|
|
RVEHICLE="$3"
|
|
|
|
|
|
|
|
# report on what cpu's we have for later log review if needed
|
|
|
|
cat /proc/cpuinfo
|
|
|
|
|
|
|
|
install_mavproxy
|
2022-07-19 09:22:05 -03:00
|
|
|
install_pymavlink
|
2018-10-03 02:20:17 -03:00
|
|
|
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
|
2022-08-01 23:27:09 -03:00
|
|
|
if [ "$NAME" == "Rover" ]; then
|
2018-10-09 07:06:36 -03:00
|
|
|
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
|
2023-03-03 20:02:02 -04:00
|
|
|
if [ "$NAME" == "Plane" ]; then
|
|
|
|
w="$w --num-aux-imus=2"
|
|
|
|
fi
|
2022-08-01 23:27:09 -03:00
|
|
|
if [ "$NAME" == "Examples" ]; then
|
2021-02-08 10:29:03 -04:00
|
|
|
w="$w --speedup=5 --timeout=14400 --debug --no-clean"
|
|
|
|
fi
|
2023-10-19 17:41:50 -03:00
|
|
|
Tools/autotest/autotest.py --show-test-timings --junit --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
|
|
|
#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
|
|
|
|
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
|
2020-11-23 12:27:44 -04:00
|
|
|
echo "Building SITL Periph GPS"
|
2023-08-21 02:21:57 -03:00
|
|
|
$waf configure --board sitl
|
2020-09-29 15:54:02 -03:00
|
|
|
$waf copter
|
2024-01-11 22:50:43 -04:00
|
|
|
run_autotest "Copter" "build.SITLPeriphUniversal" "test.CAN"
|
2020-09-29 15:54:02 -03:00
|
|
|
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
|
2023-12-27 17:21:47 -04:00
|
|
|
sudo apt-get update || /bin/true
|
|
|
|
sudo apt-get install -y ppp || /bin/true
|
2020-03-25 19:12:52 -03:00
|
|
|
run_autotest "Rover" "build.Rover" "test.Rover"
|
2018-01-22 21:33:52 -04:00
|
|
|
continue
|
2022-08-18 23:20:12 -03:00
|
|
|
fi
|
|
|
|
if [ "$t" == "sitltest-sailboat" ]; then
|
|
|
|
run_autotest "Rover" "build.Rover" "test.Sailboat"
|
|
|
|
continue
|
2018-01-22 21:33:52 -04:00
|
|
|
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
|
2023-08-24 01:28:48 -03:00
|
|
|
if [ "$t" == "sitltest-blimp" ]; then
|
|
|
|
run_autotest "Blimp" "build.Blimp" "test.Blimp"
|
|
|
|
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
|
|
|
|
|
2021-02-08 10:29:03 -04:00
|
|
|
if [ "$t" == "examples" ]; then
|
2024-02-22 21:00:13 -04:00
|
|
|
./waf configure --board=sitl --debug
|
2021-02-08 10:29:03 -04:00
|
|
|
./waf examples
|
|
|
|
run_autotest "Examples" "--no-clean" "run.examples"
|
|
|
|
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"
|
2021-12-16 01:24:16 -04:00
|
|
|
if [ -f ~/alternate_build/revo-mini/bin/AP_Bootloader.bin ]; then
|
|
|
|
rm -r ~/alternate_build
|
|
|
|
fi
|
|
|
|
$waf configure --board revo-mini --bootloader --out ~/alternate_build
|
2018-06-22 23:06:15 -03:00
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
2021-12-16 01:24:16 -04:00
|
|
|
# check if bootloader got built under alternate_build
|
|
|
|
if [ ! -f ~/alternate_build/revo-mini/bin/AP_Bootloader.bin ]; then
|
|
|
|
echo "alternate build output directory Test failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-06-22 23:06:15 -03:00
|
|
|
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
|
2021-08-11 10:49:14 -03:00
|
|
|
echo "Building CubeOrange-periph peripheral fw"
|
|
|
|
$waf configure --board CubeOrange-periph
|
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
2021-04-13 22:20:28 -03:00
|
|
|
echo "Building G4-ESC peripheral fw"
|
|
|
|
$waf configure --board G4-ESC
|
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
2021-09-19 04:56:18 -03:00
|
|
|
echo "Building Nucleo-L496 peripheral fw"
|
|
|
|
$waf configure --board Nucleo-L496
|
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
2021-10-16 21:19:19 -03:00
|
|
|
echo "Building Nucleo-L496 peripheral fw"
|
|
|
|
$waf configure --board Nucleo-L476
|
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
|
|
|
echo "Building Sierra-L431 peripheral fw"
|
|
|
|
$waf configure --board Sierra-L431
|
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
2021-04-29 02:43:35 -03:00
|
|
|
echo "Building FreeflyRTK peripheral fw"
|
|
|
|
$waf configure --board FreeflyRTK
|
|
|
|
$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
|
|
|
|
|
2023-04-12 01:38:08 -03:00
|
|
|
if [ "$t" == "CubeRedPrimary-bootloader" ]; then
|
|
|
|
echo "Building CubeRedPrimary bootloader"
|
|
|
|
$waf configure --board CubeRedPrimary --bootloader
|
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-10-04 00:10:42 -03:00
|
|
|
if [ "$t" == "fmuv3-bootloader" ]; then
|
|
|
|
echo "Building fmuv3 bootloader"
|
|
|
|
$waf configure --board fmuv3 --bootloader
|
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
|
|
|
continue
|
|
|
|
fi
|
2023-08-24 01:28:48 -03:00
|
|
|
|
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
|
2020-12-12 12:02:36 -04:00
|
|
|
|
2021-01-02 06:51:00 -04:00
|
|
|
# test bi-directional dshot build
|
|
|
|
echo "Building KakuteF7Mini"
|
|
|
|
$waf configure --Werror --board KakuteF7Mini
|
2022-02-13 10:38:00 -04:00
|
|
|
$waf clean
|
|
|
|
$waf copter
|
2021-01-02 06:51:00 -04:00
|
|
|
|
2021-01-01 21:06:25 -04:00
|
|
|
# test bi-directional dshot build and smallest flash
|
|
|
|
echo "Building KakuteF7"
|
|
|
|
$waf configure --Werror --board KakuteF7
|
2020-12-12 12:02:36 -04:00
|
|
|
$waf clean
|
|
|
|
$waf copter
|
2019-03-10 07:31:03 -03:00
|
|
|
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
|
2023-04-10 01:45:07 -03:00
|
|
|
echo "Building CPUInfo"
|
|
|
|
$waf --target=tool/CPUInfo
|
2022-02-13 10:38:00 -04:00
|
|
|
|
|
|
|
# test external flash build
|
|
|
|
echo "Building SPRacingH7"
|
|
|
|
$waf configure --Werror --board SPRacingH7
|
|
|
|
$waf clean
|
|
|
|
$waf copter
|
2019-03-10 07:31:03 -03:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2021-07-20 04:38:35 -03:00
|
|
|
if [ "$t" == "stm32h7-debug" ]; then
|
|
|
|
echo "Building Durandal"
|
|
|
|
$waf configure --board Durandal --debug
|
|
|
|
$waf clean
|
|
|
|
$waf copter
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-08-07 01:10:28 -03:00
|
|
|
if [ "$t" == "CubeOrange-ODID" ]; then
|
|
|
|
echo "Building CubeOrange-ODID"
|
|
|
|
$waf configure --board CubeOrange-ODID
|
|
|
|
$waf clean
|
|
|
|
$waf copter
|
2023-03-13 00:57:57 -03:00
|
|
|
$waf plane
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2023-12-26 03:49:49 -04:00
|
|
|
if [ "$t" == "CubeOrange-PPP" ]; then
|
|
|
|
echo "Building CubeOrange-PPP"
|
|
|
|
$waf configure --board CubeOrange --enable-ppp
|
|
|
|
$waf clean
|
|
|
|
$waf copter
|
|
|
|
continue
|
|
|
|
fi
|
2024-01-06 21:59:13 -04:00
|
|
|
|
2024-03-17 19:32:59 -03:00
|
|
|
if [ "$t" == "SOHW" ]; then
|
2024-01-06 21:59:13 -04:00
|
|
|
echo "Building CubeOrange-SOHW"
|
2024-03-17 19:32:59 -03:00
|
|
|
Tools/scripts/sitl-on-hardware/sitl-on-hw.py --board CubeOrange --vehicle copter --simclass MultiCopter
|
|
|
|
echo "Building 6X-SOHW"
|
|
|
|
Tools/scripts/sitl-on-hardware/sitl-on-hw.py --board Pixhawk6X --vehicle plane --simclass Plane --frame plane-3d
|
2024-01-06 21:59:13 -04:00
|
|
|
continue
|
|
|
|
fi
|
2024-01-12 21:55:12 -04:00
|
|
|
|
|
|
|
if [ "$t" == "Pixhawk6X-PPPGW" ]; then
|
|
|
|
echo "Building Pixhawk6X-PPPGW"
|
|
|
|
$waf configure --board Pixhawk6X-PPPGW
|
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
2024-01-14 23:12:52 -04:00
|
|
|
$waf configure --board Pixhawk6X-PPPGW --bootloader
|
|
|
|
$waf clean
|
|
|
|
$waf bootloader
|
2024-01-12 21:55:12 -04:00
|
|
|
continue
|
|
|
|
fi
|
2024-06-01 03:28:28 -03:00
|
|
|
|
|
|
|
if [ "$t" == "new-check" ]; then
|
|
|
|
echo "Building Pixhawk6X with new check"
|
|
|
|
$waf configure --board Pixhawk6X --enable-new-checking
|
|
|
|
$waf clean
|
|
|
|
$waf
|
|
|
|
echo "Building Pixhawk6X-PPPGW with new check"
|
|
|
|
$waf configure --board Pixhawk6X-PPPGW --enable-new-checking
|
|
|
|
$waf clean
|
|
|
|
$waf AP_Periph
|
|
|
|
continue
|
|
|
|
fi
|
2023-12-26 03:49:49 -04:00
|
|
|
|
2023-03-20 17:34:06 -03:00
|
|
|
if [ "$t" == "dds-stm32h7" ]; then
|
2023-03-13 00:57:57 -03:00
|
|
|
echo "Building with DDS support on a STM32H7"
|
|
|
|
$waf configure --board Durandal --enable-dds
|
|
|
|
$waf clean
|
|
|
|
$waf copter
|
2023-03-20 17:34:06 -03:00
|
|
|
$waf plane
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$t" == "dds-sitl" ]; then
|
|
|
|
echo "Building with DDS support on SITL"
|
|
|
|
$waf configure --board sitl --enable-dds
|
|
|
|
$waf clean
|
|
|
|
$waf copter
|
2022-08-07 01:10:28 -03:00
|
|
|
$waf plane
|
2023-08-22 21:17:29 -03:00
|
|
|
$waf tests
|
2022-08-07 01:10:28 -03:00
|
|
|
continue
|
|
|
|
fi
|
2023-08-24 01:28:48 -03:00
|
|
|
|
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"
|
2023-02-28 04:13:36 -04:00
|
|
|
Tools/scripts/build_iofirmware.py
|
|
|
|
# now clean up the stuff that's copied into the source tree:
|
|
|
|
git checkout Tools/IO_Firmware/
|
2018-09-14 07:12:01 -03:00
|
|
|
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
|
2022-02-10 11:06:09 -04:00
|
|
|
./Tools/scripts/firmware_version_decoder.py -f build/navigator/bin/ardusub --expected-hash $GIT_VERSION
|
2020-08-25 14:02:06 -03:00
|
|
|
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"
|
2023-06-02 12:05:45 -03:00
|
|
|
$waf configure --board sitl --debug --disable-scripting
|
2023-08-24 01:28:48 -03:00
|
|
|
|
2020-11-24 02:46:06 -04:00
|
|
|
$waf replay
|
2020-11-07 04:32:00 -04:00
|
|
|
echo "Building AP_DAL standalone test"
|
2023-06-02 12:05:45 -03:00
|
|
|
$waf configure --board sitl --debug --disable-scripting --no-gcs
|
2023-08-24 01:28:48 -03:00
|
|
|
|
2021-07-05 06:53:17 -03:00
|
|
|
$waf --target tool/AP_DAL_Standalone
|
2020-11-07 04:32:00 -04:00
|
|
|
$waf clean
|
|
|
|
continue
|
|
|
|
fi
|
2021-02-10 19:34:53 -04:00
|
|
|
|
2023-03-07 05:33:32 -04:00
|
|
|
if [ "$t" == "validate_board_list" ]; then
|
|
|
|
echo "Validating board list"
|
|
|
|
./Tools/autotest/validate_board_list.py
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2023-03-08 21:55:00 -04:00
|
|
|
if [ "$t" == "check_autotest_options" ]; then
|
|
|
|
echo "Checking autotest options"
|
|
|
|
install_mavproxy
|
|
|
|
install_pymavlink
|
|
|
|
./Tools/autotest/autotest.py --help
|
|
|
|
./Tools/autotest/autotest.py --list
|
|
|
|
./Tools/autotest/autotest.py --list-subtests
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-09-03 02:20:58 -03:00
|
|
|
if [ "$t" == "signing" ]; then
|
|
|
|
echo "Building signed firmwares"
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y python3-dev
|
2024-05-10 00:20:42 -03:00
|
|
|
python3 -m pip install pymonocypher==3.1.3.2
|
2022-09-03 02:20:58 -03:00
|
|
|
./Tools/scripts/signing/generate_keys.py testkey
|
|
|
|
$waf configure --board CubeOrange-ODID --signed-fw --private-key testkey_private_key.dat
|
|
|
|
$waf copter
|
|
|
|
$waf configure --board MatekL431-DShot --signed-fw --private-key testkey_private_key.dat
|
|
|
|
$waf AP_Periph
|
|
|
|
./Tools/scripts/build_bootloaders.py --signing-key testkey_public_key.dat CubeOrange-ODID
|
|
|
|
./Tools/scripts/build_bootloaders.py --signing-key testkey_public_key.dat MatekL431-DShot
|
|
|
|
continue
|
|
|
|
fi
|
2023-08-24 01:28:48 -03:00
|
|
|
|
2021-02-10 19:34:53 -04:00
|
|
|
if [ "$t" == "python-cleanliness" ]; then
|
|
|
|
echo "Checking Python code cleanliness"
|
|
|
|
./Tools/scripts/run_flake8.py
|
|
|
|
continue
|
|
|
|
fi
|
2019-01-05 10:22:11 -04:00
|
|
|
|
2023-04-04 23:59:12 -03:00
|
|
|
if [ "$t" == "astyle-cleanliness" ]; then
|
|
|
|
echo "Checking AStyle code cleanliness"
|
2023-08-17 19:17:54 -03:00
|
|
|
./Tools/scripts/run_astyle.py --dry-run
|
2023-04-04 23:59:12 -03:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
|
2022-07-19 09:22:05 -03:00
|
|
|
if [ "$t" == "build-options-defaults-test" ]; then
|
|
|
|
install_pymavlink
|
|
|
|
echo "Checking default options in build_options.py work"
|
|
|
|
time ./Tools/autotest/test_build_options.py \
|
|
|
|
--no-disable-all \
|
|
|
|
--no-disable-none \
|
|
|
|
--no-disable-in-turn \
|
2022-10-01 07:41:10 -03:00
|
|
|
--no-enable-in-turn \
|
2022-07-19 09:22:05 -03:00
|
|
|
--board=CubeOrange \
|
|
|
|
--build-targets=copter \
|
2022-08-31 08:34:47 -03:00
|
|
|
--build-targets=plane
|
|
|
|
echo "Checking all/none options in build_options.py work"
|
|
|
|
time ./Tools/autotest/test_build_options.py \
|
|
|
|
--no-disable-in-turn \
|
2022-10-01 07:41:10 -03:00
|
|
|
--no-enable-in-turn \
|
2022-08-31 08:34:47 -03:00
|
|
|
--build-targets=copter \
|
2022-07-19 09:22:05 -03:00
|
|
|
--build-targets=plane
|
2024-03-05 02:09:12 -04:00
|
|
|
echo "Checking building with logging disabled works"
|
|
|
|
echo "define HAL_LOGGING_ENABLED 0" >/tmp/extra.hwdef
|
|
|
|
time ./waf configure \
|
|
|
|
--board=CubeOrange \
|
|
|
|
--extra-hwdef=/tmp/extra.hwdef
|
|
|
|
time ./waf plane
|
|
|
|
time ./waf copter
|
2022-07-19 09:22:05 -03:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2023-03-08 21:59:09 -04:00
|
|
|
if [ "$t" == "param_parse" ]; then
|
2023-11-22 19:07:56 -04:00
|
|
|
for v in Rover AntennaTracker ArduCopter ArduPlane ArduSub Blimp AP_Periph; do
|
2023-03-08 21:59:09 -04:00
|
|
|
python Tools/autotest/param_metadata/param_parse.py --vehicle $v
|
|
|
|
done
|
|
|
|
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
|
|
|
|
|
|
|
echo build OK
|
|
|
|
exit 0
|