Skip to content

Commit 0a04ebf

Browse files
earlephilhowerdevyte
authored andcommitted
Add full debug builds for all tests (#5146)
* 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 #5143 * Add in dump of platform.txt to verify build options * Fix BASH comparison of strings * Fix debug-mode compile error in ESP8266AVRISP * Add -Wextra to CI (matches IDE "All" warnings)
1 parent cc284bb commit 0a04ebf

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-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:

libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ extern "C" {
2323
#include "mem.h"
2424
}
2525

26+
#ifdef malloc
27+
#undef malloc
28+
#endif
2629
#define malloc os_malloc
30+
#ifdef free
31+
#undef free
32+
#endif
2733
#define free os_free
2834

2935
// #define AVRISP_DEBUG(fmt, ...) os_printf("[AVRP] " fmt "\r\n", ##__VA_ARGS__ )

tests/common.sh

+21-6
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,24 @@ 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" = "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 -Wextra -Werror $debug_flags" > esp8266/platform.local.txt
120+
echo "compiler.cpp.extra_flags=-Wall -Wextra -Werror $debug_flags" >> esp8266/platform.local.txt
121+
echo -e "\n----platform.local.txt----"
122+
cat esp8266/platform.local.txt
123+
echo -e "\n----\n"
116124
cd esp8266/tools
117125
python get.py
118126
export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH"
@@ -197,10 +205,11 @@ function build_sketches_with_platformio()
197205

198206
function install_arduino()
199207
{
208+
local debug=$1
200209
# Install Arduino IDE and required libraries
201210
echo -e "travis_fold:start:sketch_test_env_prepare"
202211
cd $TRAVIS_BUILD_DIR
203-
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR
212+
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR $debug
204213
which arduino
205214
cd $TRAVIS_BUILD_DIR
206215
install_libraries
@@ -248,13 +257,19 @@ if [ -z "$TRAVIS_BUILD_DIR" ]; then
248257
fi
249258

250259
if [ "$BUILD_TYPE" = "build" ]; then
251-
install_arduino
260+
install_arduino nodebug
252261
build_sketches_with_arduino 1 0
253262
elif [ "$BUILD_TYPE" = "build_even" ]; then
254-
install_arduino
263+
install_arduino nodebug
255264
build_sketches_with_arduino 2 0
256265
elif [ "$BUILD_TYPE" = "build_odd" ]; then
257-
install_arduino
266+
install_arduino nodebug
267+
build_sketches_with_arduino 2 1
268+
elif [ "$BUILD_TYPE" = "debug_even" ]; then
269+
install_arduino debug
270+
build_sketches_with_arduino 2 0
271+
elif [ "$BUILD_TYPE" = "debug_odd" ]; then
272+
install_arduino debug
258273
build_sketches_with_arduino 2 1
259274
elif [ "$BUILD_TYPE" = "platformio" ]; then
260275
# PlatformIO

0 commit comments

Comments
 (0)