Skip to content

Commit

Permalink
Fix #150: add CI testing for debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Oct 14, 2018
1 parent 8860484 commit b6b96ce
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ before_install:
- "function _samdopts { echo mcci:samd:${1:-mcci_catena_4450}:lorawan_region=${2:-us915} ; }"
- "function _stm32l0opts { echo mcci:stm32:${1:-mcci_catena_4551}:lorawan_region=${2:-us915},opt=${3:-osstd},xserial=${4:-generic},usb=${5:-none},upload_method=${6:-STLink} ; }"
- "function _avropts { echo adafruit:avr:${1:-feather32u4} ; }"
- "function _esp32opts { echo esp32:esp32:${1:heltec_wifi_lora_32} ; }"
#
# Put one or more arguments into lmic_project_config.h as `#define $i\n`
- function _projcfg { for i in "$@" ; do printf '#define %s 1\n' "$i" ; done > $PWD/project_config/lmic_project_config.h ; }
# Put one or more arguments into lmic_project_config.h as `#define $i 1\n` or `#define $i $arg`
- function _splitdef { if [ "$1" = "${1/=/}" ]; then echo "$1" 1 ; else echo "${1/=/ }" ; fi ; }
- function _projcfg { for i in "$@" ; do printf '#define %s %s\n' $(_splitdef "$i") ; done > $PWD/project_config/lmic_project_config.h ; }
#
# Handy macro to deal with expected failures.
- 'function _expect_failure { if [ $? -eq 0 ]; then echo "Suceeded, but should have failed!" ; echo project_config/lmic_project_config.h ; cat $PWD/project_config/lmic_project_config.h ; return 1 ; else echo "Failed, as expected"; return 0 ; fi ; }'
#
# modify the board manager preferences to point to our BSPs.
- arduino --pref "boardsmanager.additional.urls=https://github.com/mcci-catena/arduino-boards/raw/master/BoardManagerFiles/package_mcci_index.json,https://adafruit.github.io/arduino-board-index/package_adafruit_index.json" --save-prefs
- BSPMCCI=https://github.com/mcci-catena/arduino-boards/raw/master/BoardManagerFiles/package_mcci_index.json
- BSPADAFRUIT=https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- BSPESP32=https://dl.espressif.com/dl/package_esp32_index.json
- arduino --pref "boardsmanager.additional.urls=$BSPMCCI,$BSPADAFRUIT,$BSPESP32" --save-prefs
#
# Centralize the STM32 config override. See the following:
# https://github.com/mcci-catena/Arduino_Core_STM32/issues/30
Expand All @@ -44,6 +49,7 @@ before_install:
- "echo $(_stm32l0opts) $(_stm32l0opts '' projcfg)"
- "echo $(_samdopts) $(_samdopts '' projcfg)"
- "echo $(_avropts) $(_avropts '' PROJCFG)"
- "echo $(_esp32opts) $(_esp32opts '' PROJCFG)"


install:
Expand All @@ -53,6 +59,7 @@ install:
- arduino --install-boards adafruit:avr || echo "assume adafruit:avr already installed, continue"
- arduino --install-boards mcci:samd || echo "assume mcci:samd already installed, continue"
- arduino --install-boards mcci:stm32 || echo "assume mcci:samd already installed, continue"
- arduino --install-boards esp32:esp32 || echo "assume esp32:esp32 already installed, condtinue"
- 'if [ -d $HOME/.arduino15/packages/mcci/hardware/stm32/1.1.0 ]; then echo "Work around broken BSP version 1.1.0" ; export MCCI_STM32_OPTS="$MCCI_STM32_OPTS --pref build.board=CATENA_4551" ; fi'

cache:
Expand Down Expand Up @@ -109,6 +116,9 @@ script:
#
# test ttn-otaa-feather-us915 with interrupts
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio LMIC_USE_INTERRUPTS && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino
# check that debug prints work
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio LMIC_DEBUG_LEVEL=1 LMIC_PRINTF_TO=Serial && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio LMIC_DEBUG_LEVEL=2 LMIC_PRINTF_TO=Serial && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa-feather-us915/ttn-otaa-feather-us915.ino

#
# test raw feather with au921
Expand Down Expand Up @@ -161,7 +171,6 @@ script:

#
# *** TESTS FOR STM32L0 / Catena 4551 ****
# make sure you install the BSP above.
#
- arduino --verify --board $(_stm32l0opts '' us915 ) $MCCI_STM32_OPTS $PWD/examples/raw-feather/raw-feather.ino
- arduino --verify --board $(_stm32l0opts '' eu868 ) $MCCI_STM32_OPTS $PWD/examples/raw-feather/raw-feather.ino
Expand All @@ -173,4 +182,12 @@ script:
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_stm32l0opts '' projcfg) $MCCI_STM32_OPTS $PWD/examples/ttn-otaa/ttn-otaa.ino
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_stm32l0opts '' projcfg) $MCCI_STM32_OPTS $PWD/examples/ttn-abp/ttn-abp.ino

### end of file ###
#
# *** TESTS for ESP32
#
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/ttn-otaa/ttn-otaa.ino
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/ttn-abp/ttn-abp.ino
# make sure debug works
- _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio LMIC_DEBUG_LEVEL=2 LMIC_PRINTF_TO=Serial && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/ttn-otaa/ttn-otaa.ino

### end of file ###

0 comments on commit b6b96ce

Please sign in to comment.