3 # Stops on first error, echo on
7 # Allow variable core usage, default uses two cores, to set 8 cores for example : commit-tests.sh -j8
9 # Default build treats warnings as errors, set -Wno-error to override, e.g.: commit-tests.sh -Wno-error
11 # A board name to build for, or ALL
36 if [ "$(uname)" = "Darwin" ]; then
37 SCRIPT
=$
(python
-c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")
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"}
58 if [[ " 9X AVR9X ALL " =~
" ${FLAVOR} " ]] ; then
59 # OpenTX on 9X stock with FrSky telemetry
61 cmake
${COMMON_OPTIONS} -DPCB=9X
-DHELI=YES
-DTEMPLATES=YES
-DTELEMETRY=FRSKY
${SRCDIR}
62 make -j${CORES} ${FIRMARE_TARGET}
64 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
66 # OpenTX on 9X stock with Ardupilot telemetry
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
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
80 cmake
${COMMON_OPTIONS} -DPCB=MEGA2560
-DTEMPLATES=YES
-DHELI=YES
${SRCDIR}
81 make -j${CORES} ${FIRMARE_TARGET}
83 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
85 # OpenTX on Mega2560 with Mavlink telemetry
87 cmake
${COMMON_OPTIONS} -DPCB=MEGA2560
-DTELEMETRY=MAVLINK
-DHELI=YES
-DTEMPLATES=YES
-DAUDIO=YES
-DVOICE=YES
${SRCDIR}
88 make -j${CORES} ${FIRMARE_TARGET}
90 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
93 if [[ " GRUVIN9X AVR9X ALL " =~
" ${FLAVOR} " ]] ; then
94 # OpenTX on gruvin9x board
96 cmake
${COMMON_OPTIONS} -DPCB=GRUVIN9X
-DHELI=YES
-DTEMPLATES=YES
-DAUDIO=YES
-DVOICE=YES
${SRCDIR}
97 make -j${CORES} ${FIRMARE_TARGET}
99 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
102 if [[ " SKY9X ARM9X ALL " =~
" ${FLAVOR} " ]] ; then
105 cmake
${COMMON_OPTIONS} -DPCB=SKY9X
-DHELI=YES
${SRCDIR}
106 make -j${CORES} ${FIRMARE_TARGET}
108 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
111 if [[ " AR9X ARM9X ALL " =~
" ${FLAVOR} " ]] ; then
114 cmake
${COMMON_OPTIONS} -DPCB=AR9X
-DHELI=YES
${SRCDIR}
115 make -j${CORES} ${FIRMARE_TARGET}
117 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
120 if [[ " 9XRPRO ARM9X ALL " =~
" ${FLAVOR} " ]] ; then
123 cmake
${COMMON_OPTIONS} -DPCB=9XRPRO
-DHELI=YES
${SRCDIR}
124 make -j${CORES} ${FIRMARE_TARGET}
126 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
129 if [[ " X7 ALL " =~
" ${FLAVOR} " ]] ; then
132 cmake
${COMMON_OPTIONS} -DPCB=X7
-DHELI=YES
${SRCDIR}
133 make -j${CORES} ${FIRMARE_TARGET}
135 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
138 if [[ " X9D X9 ALL " =~
" ${FLAVOR} " ]] ; then
141 cmake
${COMMON_OPTIONS} -DPCB=X9D
-DHELI=YES
-DLUA=YES
-DGVARS=YES
${SRCDIR}
142 make -j${CORES} ${FIRMARE_TARGET}
144 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
147 if [[ " X9D+ X9 ALL " =~
" ${FLAVOR} " ]] ; then
150 cmake
${COMMON_OPTIONS} -DPCB=X9D
+ -DHELI=YES
-DLUA=YES
-DGVARS=YES
${SRCDIR}
151 make -j${CORES} ${FIRMARE_TARGET}
153 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
156 if [[ " X9E X9 ALL " =~
" ${FLAVOR} " ]] ; then
157 # OpenTX on Taranis X9E
159 cmake
${COMMON_OPTIONS} -DPCB=X9E
-DHELI=YES
-DLUA=YES
-DGVARS=YES
-DPPM_UNIT=PERCENT_PREC1
${SRCDIR}
160 make -j${CORES} ${FIRMARE_TARGET}
162 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
165 if [[ " X10 HORUS ALL " =~
" ${FLAVOR} " ]] ; then
166 # OpenTX on X10 boards
168 cmake
${COMMON_OPTIONS} -DPCB=X10
-DHELI=YES
-DLUA=YES
-DGVARS=YES
${SRCDIR}
169 make -j${CORES} ${FIRMARE_TARGET}
171 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
174 if [[ " X12Sr10 HORUS ALL " =~
" ${FLAVOR} " ]] ; then
175 # OpenTX on Horus beta boards
177 cmake
${COMMON_OPTIONS} -DPCB=X12S
-DPCBREV=10 -DHELI=YES
-DLUA=YES
-DGVARS=YES
${SRCDIR}
178 make -j${CORES} ${FIRMARE_TARGET}
180 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
183 if [[ " X12S HORUS ALL " =~
" ${FLAVOR} " ]] ; then
186 cmake
${COMMON_OPTIONS} -DPCB=X12S
-DHELI=YES
-DLUA=YES
-DGVARS=YES
${SRCDIR}
187 make -j${CORES} ${FIRMARE_TARGET}
189 make -j${CORES} gtests
; .
/gtests
${TEST_OPTIONS}
192 if [[ " DEFAULT ALL " =~
" ${FLAVOR} " ]] ; then
195 cmake
${COMMON_OPTIONS} ${SRCDIR}