Skip to content

Commit

Permalink
Add full debug builds for all tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
earlephilhower committed Sep 18, 2018
1 parent cd43337 commit aaccfc4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ matrix:
- BUILD_TYPE=build_even
- env:
- BUILD_TYPE=build_odd
- env:
- BUILD_TYPE=debug_even
- env:
- BUILD_TYPE=debug_odd
- env:
- BUILD_TYPE=platformio
- env:
Expand Down
24 changes: 18 additions & 6 deletions tests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,21 @@ function install_ide()
{
local ide_path=$1
local core_path=$2
local debug=$3
wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
tar xf arduino.tar.xz
mv arduino-nightly $ide_path
cd $ide_path/hardware
mkdir esp8266com
cd esp8266com
ln -s $core_path esp8266
local debug_flags=""
if [ "$debug" -eq "debug" ]; then
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"
fi
# Set custom warnings for all builds (i.e. could add -Wextra at some point)
echo "compiler.c.extra_flags=-Wall -Werror" > esp8266/platform.local.txt
echo "compiler.cpp.extra_flags=-Wall -Werror" >> esp8266/platform.local.txt
echo "compiler.c.extra_flags=-Wall -Werror $debug_flags" > esp8266/platform.local.txt
echo "compiler.cpp.extra_flags=-Wall -Werror $debug_flags" >> esp8266/platform.local.txt
cd esp8266/tools
python get.py
export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH"
Expand Down Expand Up @@ -197,10 +202,11 @@ function build_sketches_with_platformio()

function install_arduino()
{
local debug=$1
# Install Arduino IDE and required libraries
echo -e "travis_fold:start:sketch_test_env_prepare"
cd $TRAVIS_BUILD_DIR
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR $debug
which arduino
cd $TRAVIS_BUILD_DIR
install_libraries
Expand Down Expand Up @@ -248,13 +254,19 @@ if [ -z "$TRAVIS_BUILD_DIR" ]; then
fi

if [ "$BUILD_TYPE" = "build" ]; then
install_arduino
install_arduino nodebug
build_sketches_with_arduino 1 0
elif [ "$BUILD_TYPE" = "build_even" ]; then
install_arduino
install_arduino nodebug
build_sketches_with_arduino 2 0
elif [ "$BUILD_TYPE" = "build_odd" ]; then
install_arduino
install_arduino nodebug
build_sketches_with_arduino 2 1
elif [ "$BUILD_TYPE" = "debug_even" ]; then
install_arduino debug
build_sketches_with_arduino 2 0
elif [ "$BUILD_TYPE" = "debug_odd" ]; then
install_arduino debug
build_sketches_with_arduino 2 1
elif [ "$BUILD_TYPE" = "platformio" ]; then
# PlatformIO
Expand Down

0 comments on commit aaccfc4

Please sign in to comment.