Skip to content

Commit aaccfc4

Browse files
Add full debug builds for all tests
In order to ensure the -DEBUG builds don't fail with checked-in code, add two jobs which build even/odd with full debug flags to Travis. Fixes esp8266#5143
1 parent cd43337 commit aaccfc4

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ matrix:
1313
- BUILD_TYPE=build_even
1414
- env:
1515
- BUILD_TYPE=build_odd
16+
- env:
17+
- BUILD_TYPE=debug_even
18+
- env:
19+
- BUILD_TYPE=debug_odd
1620
- env:
1721
- BUILD_TYPE=platformio
1822
- env:

tests/common.sh

+18-6
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,21 @@ function install_ide()
103103
{
104104
local ide_path=$1
105105
local core_path=$2
106+
local debug=$3
106107
wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
107108
tar xf arduino.tar.xz
108109
mv arduino-nightly $ide_path
109110
cd $ide_path/hardware
110111
mkdir esp8266com
111112
cd esp8266com
112113
ln -s $core_path esp8266
114+
local debug_flags=""
115+
if [ "$debug" -eq "debug" ]; then
116+
debug_flags="-DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM"
117+
fi
113118
# Set custom warnings for all builds (i.e. could add -Wextra at some point)
114-
echo "compiler.c.extra_flags=-Wall -Werror" > esp8266/platform.local.txt
115-
echo "compiler.cpp.extra_flags=-Wall -Werror" >> esp8266/platform.local.txt
119+
echo "compiler.c.extra_flags=-Wall -Werror $debug_flags" > esp8266/platform.local.txt
120+
echo "compiler.cpp.extra_flags=-Wall -Werror $debug_flags" >> esp8266/platform.local.txt
116121
cd esp8266/tools
117122
python get.py
118123
export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH"
@@ -197,10 +202,11 @@ function build_sketches_with_platformio()
197202

198203
function install_arduino()
199204
{
205+
local debug=$1
200206
# Install Arduino IDE and required libraries
201207
echo -e "travis_fold:start:sketch_test_env_prepare"
202208
cd $TRAVIS_BUILD_DIR
203-
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR
209+
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR $debug
204210
which arduino
205211
cd $TRAVIS_BUILD_DIR
206212
install_libraries
@@ -248,13 +254,19 @@ if [ -z "$TRAVIS_BUILD_DIR" ]; then
248254
fi
249255

250256
if [ "$BUILD_TYPE" = "build" ]; then
251-
install_arduino
257+
install_arduino nodebug
252258
build_sketches_with_arduino 1 0
253259
elif [ "$BUILD_TYPE" = "build_even" ]; then
254-
install_arduino
260+
install_arduino nodebug
255261
build_sketches_with_arduino 2 0
256262
elif [ "$BUILD_TYPE" = "build_odd" ]; then
257-
install_arduino
263+
install_arduino nodebug
264+
build_sketches_with_arduino 2 1
265+
elif [ "$BUILD_TYPE" = "debug_even" ]; then
266+
install_arduino debug
267+
build_sketches_with_arduino 2 0
268+
elif [ "$BUILD_TYPE" = "debug_odd" ]; then
269+
install_arduino debug
258270
build_sketches_with_arduino 2 1
259271
elif [ "$BUILD_TYPE" = "platformio" ]; then
260272
# PlatformIO

0 commit comments

Comments
 (0)