Bitmaps with a too big filename were displayed in the selection popup (#4646)
[opentx.git] / tools / commit-tests.sh
blob309f8caf040ef67943140f2e8cca9e0ff48303ff
1 #!/bin/bash
3 # Stops on first error, echo on
4 set -e
5 set -x
7 # Allow variable core usage, default uses two cores, to set 8 cores for example : commit-tests.sh -j8
8 : ${CORES:=2}
9 # Default build treats warnings as errors, set -Wno-error to override, e.g.: commit-tests.sh -Wno-error
10 : ${WERROR:=1}
11 # A board name to build for, or ALL
12 : ${FLAVOR:=ALL}
14 for i in "$@"
16 case $i in
17 --jobs=*)
18 CORES="${i#*=}"
19 shift
21 -j*)
22 CORES="${i#*j}"
23 shift
25 -Wno-error)
26 WERROR=0
27 shift
29 -b*)
30 FLAVOR="${i#*b}"
31 shift
33 esac
34 done
36 if [ "$(uname)" = "Darwin" ]; then
37 SCRIPT=$(python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")
38 else
39 SCRIPT=$(readlink -f "$0")
41 #export CMAKE_PREFIX_PATH=/opt/qt${QT_BASE}
42 if [[ ! -z ${GCC_ARM} ]] ; then
43 export PATH=${GCC_ARM}:$PATH
46 : ${SRCDIR:=$(dirname "$SCRIPT")/..}
48 : ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=Debug -DTRACE_SIMPGMSPACE=NO -DVERBOSE_CMAKELISTS=YES -DCMAKE_RULE_MESSAGES=OFF -Wno-dev"}
49 if (( $WERROR )); then COMMON_OPTIONS+=" -DWARNINGS_AS_ERRORS=YES"; fi
51 : ${TEST_OPTIONS:="--gtest_shuffle --gtest_repeat=5 --gtest_break_on_failure"}
53 : ${FIRMARE_TARGET:="firmware-size"}
55 mkdir build || true
56 cd build
58 if [[ " 9X AVR9X ALL " =~ " ${FLAVOR} " ]] ; then
59 # OpenTX on 9X stock with FrSky telemetry
60 rm -rf *
61 cmake ${COMMON_OPTIONS} -DPCB=9X -DHELI=YES -DTEMPLATES=YES -DTELEMETRY=FRSKY ${SRCDIR}
62 make -j${CORES} ${FIRMARE_TARGET}
63 make -j${CORES} simu
64 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
66 # OpenTX on 9X stock with Ardupilot telemetry
67 rm -rf *
68 cmake ${COMMON_OPTIONS} -DPCB=9X -DHELI=YES -DTEMPLATES=YES -DTELEMETRY=ARDUPILOT ${SRCDIR}
69 make -j${CORES} ${FIRMARE_TARGET}
71 # OpenTX on 9X stock with JETI telemetry
72 rm -rf *
73 cmake ${COMMON_OPTIONS} -DPCB=9X -DHELI=YES -DTEMPLATES=YES -DTELEMETRY=JETI ${SRCDIR}
74 make -j${CORES} ${FIRMARE_TARGET}
77 if [[ " MEGA2560 AVR9X ALL " =~ " ${FLAVOR} " ]] ; then
78 # OpenTX on Mega2560
79 rm -rf *
80 cmake ${COMMON_OPTIONS} -DPCB=MEGA2560 -DTEMPLATES=YES -DHELI=YES ${SRCDIR}
81 make -j${CORES} ${FIRMARE_TARGET}
82 make -j${CORES} simu
83 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
85 # OpenTX on Mega2560 with Mavlink telemetry
86 rm -rf *
87 cmake ${COMMON_OPTIONS} -DPCB=MEGA2560 -DTELEMETRY=MAVLINK -DHELI=YES -DTEMPLATES=YES -DAUDIO=YES -DVOICE=YES ${SRCDIR}
88 make -j${CORES} ${FIRMARE_TARGET}
89 make -j${CORES} simu
90 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
93 if [[ " GRUVIN9X AVR9X ALL " =~ " ${FLAVOR} " ]] ; then
94 # OpenTX on gruvin9x board
95 rm -rf *
96 cmake ${COMMON_OPTIONS} -DPCB=GRUVIN9X -DHELI=YES -DTEMPLATES=YES -DAUDIO=YES -DVOICE=YES ${SRCDIR}
97 make -j${CORES} ${FIRMARE_TARGET}
98 make -j${CORES} simu
99 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
102 if [[ " SKY9X ARM9X ALL " =~ " ${FLAVOR} " ]] ; then
103 # OpenTX on Sky9x
104 rm -rf *
105 cmake ${COMMON_OPTIONS} -DPCB=SKY9X -DHELI=YES ${SRCDIR}
106 make -j${CORES} ${FIRMARE_TARGET}
107 make -j${CORES} simu
108 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
111 if [[ " AR9X ARM9X ALL " =~ " ${FLAVOR} " ]] ; then
112 # OpenTX on AR9X
113 rm -rf *
114 cmake ${COMMON_OPTIONS} -DPCB=AR9X -DHELI=YES ${SRCDIR}
115 make -j${CORES} ${FIRMARE_TARGET}
116 make -j${CORES} simu
117 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
120 if [[ " 9XRPRO ARM9X ALL " =~ " ${FLAVOR} " ]] ; then
121 # OpenTX on Sky9x
122 rm -rf *
123 cmake ${COMMON_OPTIONS} -DPCB=9XRPRO -DHELI=YES ${SRCDIR}
124 make -j${CORES} ${FIRMARE_TARGET}
125 make -j${CORES} simu
126 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
129 if [[ " X7 ALL " =~ " ${FLAVOR} " ]] ; then
130 # OpenTX on X7
131 rm -rf *
132 cmake ${COMMON_OPTIONS} -DPCB=X7 -DHELI=YES ${SRCDIR}
133 make -j${CORES} ${FIRMARE_TARGET}
134 make -j${CORES} simu
135 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
138 if [[ " X9D X9 ALL " =~ " ${FLAVOR} " ]] ; then
139 # OpenTX on X9D
140 rm -rf *
141 cmake ${COMMON_OPTIONS} -DPCB=X9D -DHELI=YES -DLUA=YES -DGVARS=YES ${SRCDIR}
142 make -j${CORES} ${FIRMARE_TARGET}
143 make -j${CORES} simu
144 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
147 if [[ " X9D+ X9 ALL " =~ " ${FLAVOR} " ]] ; then
148 # OpenTX on X9D+
149 rm -rf *
150 cmake ${COMMON_OPTIONS} -DPCB=X9D+ -DHELI=YES -DLUA=YES -DGVARS=YES ${SRCDIR}
151 make -j${CORES} ${FIRMARE_TARGET}
152 make -j${CORES} simu
153 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
156 if [[ " X9E X9 ALL " =~ " ${FLAVOR} " ]] ; then
157 # OpenTX on Taranis X9E
158 rm -rf *
159 cmake ${COMMON_OPTIONS} -DPCB=X9E -DHELI=YES -DLUA=YES -DGVARS=YES -DPPM_UNIT=PERCENT_PREC1 ${SRCDIR}
160 make -j${CORES} ${FIRMARE_TARGET}
161 make -j${CORES} simu
162 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
165 if [[ " X10 HORUS ALL " =~ " ${FLAVOR} " ]] ; then
166 # OpenTX on X10 boards
167 rm -rf *
168 cmake ${COMMON_OPTIONS} -DPCB=X10 -DHELI=YES -DLUA=YES -DGVARS=YES ${SRCDIR}
169 make -j${CORES} ${FIRMARE_TARGET}
170 make -j${CORES} simu
171 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
174 if [[ " X12Sr10 HORUS ALL " =~ " ${FLAVOR} " ]] ; then
175 # OpenTX on Horus beta boards
176 rm -rf *
177 cmake ${COMMON_OPTIONS} -DPCB=X12S -DPCBREV=10 -DHELI=YES -DLUA=YES -DGVARS=YES ${SRCDIR}
178 make -j${CORES} ${FIRMARE_TARGET}
179 make -j${CORES} simu
180 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
183 if [[ " X12S HORUS ALL " =~ " ${FLAVOR} " ]] ; then
184 # OpenTX on Horus
185 rm -rf *
186 cmake ${COMMON_OPTIONS} -DPCB=X12S -DHELI=YES -DLUA=YES -DGVARS=YES ${SRCDIR}
187 make -j${CORES} ${FIRMARE_TARGET}
188 make -j${CORES} simu
189 make -j${CORES} gtests ; ./gtests ${TEST_OPTIONS}
192 if [[ " DEFAULT ALL " =~ " ${FLAVOR} " ]] ; then
193 # Companion
194 rm -rf *
195 cmake ${COMMON_OPTIONS} ${SRCDIR}
196 make -j${CORES}