mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 20:48:33 -04:00
Tools: scripts: build_ci.sh: factor out run_autotest function
This commit is contained in:
parent
a543023e1b
commit
d858569544
@ -40,54 +40,46 @@ function get_time {
|
|||||||
echo "Targets: $CI_BUILD_TARGET"
|
echo "Targets: $CI_BUILD_TARGET"
|
||||||
echo "Compiler: $c_compiler"
|
echo "Compiler: $c_compiler"
|
||||||
|
|
||||||
if [ $c_compiler == "clang" ]; then
|
pymavlink_installed=0
|
||||||
autotest_args='--waf-configure-args="--check-c-compiler=clang --check-cxx-compiler=clang++"'
|
|
||||||
fi
|
function run_autotest() {
|
||||||
|
NAME="$1"
|
||||||
|
BVEHICLE="$2"
|
||||||
|
RVEHICLE="$3"
|
||||||
|
|
||||||
|
if [ pymavlink_installed -eq 0 ]; then
|
||||||
|
echo "Installing pymavlink"
|
||||||
|
git submodule init
|
||||||
|
git submodule update
|
||||||
|
(cd modules/mavlink/pymavlink && python setup.py build install --user)
|
||||||
|
pymavlink_installed=1
|
||||||
|
fi
|
||||||
|
unset BUILDROOT
|
||||||
|
echo "Running SITL $NAME test"
|
||||||
|
|
||||||
|
if [ $c_compiler == "clang" ]; then
|
||||||
|
w="--check-c-compiler=clang --check-cxx-compiler=clang++"
|
||||||
|
fi
|
||||||
|
Tools/autotest/autotest.py --waf-configure-args="$w" "$BVEHICLE" "$RVEHICLE"
|
||||||
|
ccache -s && ccache -z
|
||||||
|
}
|
||||||
|
|
||||||
for t in $CI_BUILD_TARGET; do
|
for t in $CI_BUILD_TARGET; do
|
||||||
# special case for SITL testing in CI
|
# special case for SITL testing in CI
|
||||||
if [ $t == "sitltest-copter" ]; then
|
if [ $t == "sitltest-copter" ]; then
|
||||||
echo "Installing pymavlink"
|
run_autotest "Copter" "build.ArduCopter" "fly.ArduCopter"
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
(cd modules/mavlink/pymavlink && python setup.py build install --user)
|
|
||||||
unset BUILDROOT
|
|
||||||
echo "Running SITL QuadCopter test"
|
|
||||||
Tools/autotest/autotest.py build.ArduCopter fly.ArduCopter $autotest_args
|
|
||||||
ccache -s && ccache -z
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ $t == "sitltest-plane" ]; then
|
if [ $t == "sitltest-plane" ]; then
|
||||||
echo "Installing pymavlink"
|
run_autotest "Plane" "build.ArduPlane" "fly.ArduPlane"
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
(cd modules/mavlink/pymavlink && python setup.py build install --user)
|
|
||||||
unset BUILDROOT
|
|
||||||
echo "Running SITL Plane test"
|
|
||||||
Tools/autotest/autotest.py build.ArduPlane fly.ArduPlane $autotest_args
|
|
||||||
ccache -s && ccache -z
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ $t == "sitltest-quadplane" ]; then
|
if [ $t == "sitltest-quadplane" ]; then
|
||||||
echo "Installing pymavlink"
|
run_autotest "QuadPlane" "build.ArduPlane" "fly.QuadPlane"
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
(cd modules/mavlink/pymavlink && python setup.py build install --user)
|
|
||||||
unset BUILDROOT
|
|
||||||
echo "Running SITL QuadPlane test"
|
|
||||||
Tools/autotest/autotest.py build.ArduPlane fly.QuadPlane $autotest_args
|
|
||||||
ccache -s && ccache -z
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ $t == "sitltest-rover" ]; then
|
if [ $t == "sitltest-rover" ]; then
|
||||||
echo "Installing pymavlink"
|
run_autotest "Rover" "build.APMrover2" "drive.APMrover2"
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
(cd modules/mavlink/pymavlink && python setup.py build install --user)
|
|
||||||
unset BUILDROOT
|
|
||||||
echo "Running SITL Rover test"
|
|
||||||
Tools/autotest/autotest.py build.APMrover2 drive.APMrover2 $autotest_args
|
|
||||||
ccache -s && ccache -z
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user