2019-08-11 22:08:55 -03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# EXECUTE enough code via the autotest tool to see coverage results
|
|
|
|
# afterwards, but don't build/rebuild anything our aim here is to try
|
|
|
|
# to execute as many code path/s as we have available to us, and we'll
|
|
|
|
# afterward report on the percentage of code executed and not executed
|
|
|
|
# etc.
|
|
|
|
|
|
|
|
export CCFLAGS="$CCFLAGS -fprofile-arcs -ftest-coverage"
|
|
|
|
export CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
|
|
|
|
export LINKFLAGS="$LINKFLAGS -lgcov -coverage"
|
|
|
|
|
2019-11-07 21:32:47 -04:00
|
|
|
SPEEDUP=5
|
|
|
|
TIMEOUT=14400
|
|
|
|
|
|
|
|
OPTS="--speedup=$SPEEDUP --timeout=$TIMEOUT --debug --no-clean"
|
|
|
|
|
2020-01-04 19:31:52 -04:00
|
|
|
rm -rf build
|
|
|
|
|
2019-08-11 22:08:55 -03:00
|
|
|
# Run examples
|
2019-11-07 21:32:47 -04:00
|
|
|
./waf configure --board=linux --debug
|
2019-08-11 22:08:55 -03:00
|
|
|
./waf examples
|
2019-11-07 21:32:47 -04:00
|
|
|
./Tools/autotest/autotest.py $OPTS run.examples
|
2019-08-11 22:08:55 -03:00
|
|
|
|
|
|
|
# Run unit tests
|
2019-11-07 21:32:47 -04:00
|
|
|
./Tools/autotest/autotest.py $OPTS build.unit_tests run.unit_tests
|
2019-08-11 22:08:55 -03:00
|
|
|
|
|
|
|
# Run main vehicle tests
|
2020-03-26 23:46:12 -03:00
|
|
|
./Tools/autotest/autotest.py $OPTS build.Plane test.Plane test.QuadPlane
|
|
|
|
./Tools/autotest/autotest.py $OPTS build.Sub test.Sub
|
|
|
|
./Tools/autotest/autotest.py $OPTS build.Copter test.Copter
|
|
|
|
./Tools/autotest/autotest.py $OPTS build.Helicopter test.Helicopter
|
|
|
|
./Tools/autotest/autotest.py $OPTS build.Tracker test.Tracker
|
|
|
|
./Tools/autotest/autotest.py $OPTS build.Rover test.Rover
|
2019-08-11 22:08:55 -03:00
|
|
|
|
|
|
|
#TODO add any other execution path/s we can to maximise the actually
|
|
|
|
# used code, can we run other tests or things? Replay, perhaps?
|
|
|
|
|
2021-03-07 07:16:32 -04:00
|
|
|
SCRIPT=$(readlink -f "$0")
|
|
|
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
2019-08-11 22:08:55 -03:00
|
|
|
|
2021-03-07 07:16:32 -04:00
|
|
|
$SCRIPTPATH/update-coverage.sh
|
2019-08-11 22:08:55 -03:00
|
|
|
|