3 # Stops on first error, echo on
7 # Allow variable core usage, default uses all cpu cores, to set 8 cores for example : commit-tests.sh -j8
8 num_cpus
=$
(grep 'physical id' /proc
/cpuinfo |
sort -u |
wc -l)
9 : "${CORES:=$num_cpus}"
10 # Default build treats warnings as errors, set -Wno-error to override, e.g.: commit-tests.sh -Wno-error
12 # A board name to build for, or ALL
37 if [ "$(uname)" = "Darwin" ]; then
38 SCRIPT
=$
(python
-c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")
40 SCRIPT
=$
(readlink
-f "$0")
43 if [[ -n ${GCC_ARM} ]] ; then
44 export PATH
=${GCC_ARM}:$PATH
47 : ${SRCDIR:=$(dirname "$SCRIPT")/..}
49 : ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=Debug -DTRACE_SIMPGMSPACE=NO -DVERBOSE_CMAKELISTS=YES -DCMAKE_RULE_MESSAGES=OFF -Wno-dev"}
50 if (( $WERROR )); then COMMON_OPTIONS
+=" -DWARNINGS_AS_ERRORS=YES -DMULTIMODULE=YES"; fi
52 : ${EXTRA_OPTIONS:="$EXTRA_OPTIONS"}
54 COMMON_OPTIONS
+=${EXTRA_OPTIONS}
56 : ${FIRMARE_TARGET:="firmware-size"}
61 if [[ " SKY9X ARM9X ALL " =~ \
${FLAVOR}\
]] ; then
64 cmake
"${COMMON_OPTIONS}" -DPCB=SKY9X
-DHELI=YES DLUA
=YES
-DTELEMETRY=FRSKY
-DPPM_LIMITS_SYMETRICAL=YES
-DVARIO=YES
-DAUTOSWITCH=YES
-DAUTOSOURCE=YES
-DAUDIO=YES
-DGPS=YES
-DPPM_CENTER_ADJUSTABLE=YES
-DFLIGHT_MODES=YES
-DOVERRIDE_CHANNEL_FUNCTION=YES
-DFRSKY_STICKS=YES
-DGVARS=YES
"${SRCDIR}"
65 make -j"${CORES}" ${FIRMARE_TARGET}
66 make -j"${CORES}" libsimulator
67 make -j"${CORES}" tests-radio
70 if [[ " AR9X ARM9X ALL " =~ \
${FLAVOR}\
]] ; then
73 cmake
"${COMMON_OPTIONS}" -DPCB=AR9X
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
74 make -j"${CORES}" ${FIRMARE_TARGET}
75 make -j"${CORES}" libsimulator
76 make -j"${CORES}" tests-radio
79 if [[ " 9XRPRO ARM9X ALL " =~ \
${FLAVOR}\
]] ; then
82 cmake
"${COMMON_OPTIONS}" -DPCB=9XRPRO
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
83 make -j"${CORES}" ${FIRMARE_TARGET}
84 make -j"${CORES}" libsimulator
85 make -j"${CORES}" tests-radio
88 if [[ " X9LITE ALL " =~ \
${FLAVOR}\
]] ; then
91 cmake
"${COMMON_OPTIONS}" -DPCB=X9LITE
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
92 make -j"${CORES}" ${FIRMARE_TARGET}
93 make -j"${CORES}" libsimulator
94 make -j"${CORES}" tests-radio
97 if [[ " X9LITES X9LITE ALL " =~ \
${FLAVOR}\
]] ; then
100 cmake
"${COMMON_OPTIONS}" -DPCB=X9LITES
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
101 make -j"${CORES}" ${FIRMARE_TARGET}
102 make -j"${CORES}" libsimulator
103 make -j"${CORES}" tests-radio
106 if [[ " X7 ALL " =~ \
${FLAVOR}\
]] ; then
109 cmake
"${COMMON_OPTIONS}" -DPCB=X7
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
110 make -j"${CORES}" ${FIRMARE_TARGET}
111 make -j"${CORES}" libsimulator
112 make -j"${CORES}" tests-radio
115 if [[ " T12 X7 ALL " =~ \
${FLAVOR}\
]] ; then
118 cmake
"${COMMON_OPTIONS}" -DPCB=X7
-DPCBREV=T12
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
119 make -j"${CORES}" ${FIRMARE_TARGET}
120 make -j"${CORES}" libsimulator
121 make -j"${CORES}" tests-radio
124 if [[ " XLITE ALL " =~ \
${FLAVOR}\
]] ; then
127 cmake
"${COMMON_OPTIONS}" -DPCB=XLITE
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
128 make -j"${CORES}" ${FIRMARE_TARGET}
129 make -j"${CORES}" libsimulator
130 make -j"${CORES}" tests-radio
133 if [[ " XLITES XLITE ALL " =~ \
${FLAVOR}\
]] ; then
136 cmake
"${COMMON_OPTIONS}" -DPCB=XLITES
-DHELI=YES
-DGVARS=YES
"${SRCDIR}"
137 make -j"${CORES}" ${FIRMARE_TARGET}
138 make -j"${CORES}" libsimulator
139 make -j"${CORES}" tests-radio
142 if [[ " X9D X9 ALL " =~ \
${FLAVOR}\
]] ; then
145 cmake
"${COMMON_OPTIONS}" -DPCB=X9D
-DHELI=YES
-DLUA=YES
-DGVARS=YES
"${SRCDIR}"
146 make -j"${CORES}" ${FIRMARE_TARGET}
147 make -j"${CORES}" libsimulator
148 make -j"${CORES}" tests-radio
151 if [[ " X9D+ X9 ALL " =~ \
${FLAVOR}\
]] ; then
154 cmake
"${COMMON_OPTIONS}" -DPCB=X9D
+ -DHELI=YES
-DLUA=YES
-DGVARS=YES
"${SRCDIR}"
155 make -j"${CORES}" ${FIRMARE_TARGET}
156 make -j"${CORES}" libsimulator
157 make -j"${CORES}" tests-radio
160 if [[ " X9D+2019 X9 ALL " =~ \
${FLAVOR}\
]] ; then
161 # OpenTX on X9D+ 2019
163 cmake
"${COMMON_OPTIONS}" -DPCB=X9D
+ -DPCBREV=2019 -DHELI=YES
-DLUA=YES
-DGVARS=YES
"${SRCDIR}"
164 make -j"${CORES}" ${FIRMARE_TARGET}
165 make -j"${CORES}" libsimulator
166 make -j"${CORES}" tests-radio
169 if [[ " X9E X9 ALL " =~ \
${FLAVOR}\
]] ; then
170 # OpenTX on Taranis X9E
172 cmake
"${COMMON_OPTIONS}" -DPCB=X9E
-DHELI=YES
-DLUA=YES
-DGVARS=YES
-DPPM_UNIT=PERCENT_PREC1
"${SRCDIR}"
173 make -j"${CORES}" ${FIRMARE_TARGET}
174 make -j"${CORES}" libsimulator
175 make -j"${CORES}" tests-radio
178 if [[ " X10 COLORLCD ALL " =~ \
${FLAVOR}\
]] ; then
179 # OpenTX on X10 boards
181 cmake
"${COMMON_OPTIONS}" -DPCB=X10
-DHELI=YES
-DLUA=YES
-DGVARS=YES
"${SRCDIR}"
182 make -j"${CORES}" ${FIRMARE_TARGET}
183 make -j"${CORES}" libsimulator
184 make -j"${CORES}" tests-radio
187 if [[ " X12S COLORLCD ALL " =~ \
${FLAVOR}\
]] ; then
190 cmake
"${COMMON_OPTIONS}" -DPCB=X12S
-DHELI=YES
-DLUA=YES
-DGVARS=YES
"${SRCDIR}"
191 make -j"${CORES}" ${FIRMARE_TARGET}
192 make -j"${CORES}" libsimulator
193 make -j"${CORES}" tests-radio
196 if [[ " COMPANION ALL " =~ \
${FLAVOR}\
]] ; then
199 cmake
"${COMMON_OPTIONS}" "${SRCDIR}"
200 make -j"${CORES}" companion23 simulator23
201 make -j"${CORES}" tests-companion