Skip to content

Commit

Permalink
Fix #13: test with STM32L0 BSP
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Aug 5, 2018
1 parent bdd8eac commit 97e20b5
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .travis.yml
@@ -1,4 +1,18 @@
# Travis script for test-building this library.
##############################################################################
#
# File: .travis.yml
#
# Function:
# Travis script for test-building this library.
#
# Copyright Notice:
# See LICENSE file accompanying this project.
#
# Author:
# Terry Moore, MCCI Corporation June 2018
#
##############################################################################

language: c
dist: trusty
sudo: false
Expand All @@ -20,7 +34,6 @@ before_install:
- export REQLIBS=
- ln -s $PWD $THISLIB
- export NONCEDIR="$PWD/tmp"
- export UNITDIR="$NONCEDIR/$(basename $MYUNIT .ino)"

#
# functions to generate the board settings for SAMD, STM32L0, ...
Expand All @@ -29,17 +42,22 @@ before_install:
# Changes to the BSP may break this build, sorry!
#
- "function _samdopts { echo mcci:samd:${1:-mcci_catena_4450}:lorawan_region=${2:-us915} ; }"
- "function _stm32l0opts { echo mcci:stm32:Catena:pnum=${1:-CATENA_4551}:opt=${3:-osstd}:xserial=${4:-generic}:usb=${5:-none}:upload_method=${6:-STLink} ; }"
- "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} ; }"
- export MCCI_STM32_OPTS="--pref recipe.hooks.objcopy.postobjcopy.1.pattern=true"

#
# Put one or more arguments into lmic_project_config.h as `#define $i\n`
- function _maketestheader { UNIT="$1" ; shift ; UNITDIR="$NONCEDIR/$(basename $UNIT .ino)" ; rm -rf $UNITDIR ; mkdir -p $UNITDIR ; { for i in "$@" ; do printf '#include "%s"\n' "$i" ; done ; printf 'void setup() {}\nvoid loop() {}\n' ; } > $UNITDIR/$UNIT ; echo $UNITDIR/$UNIT ; }

#
# 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 $HOME/arduino_ide/libraries/arduino-lmic/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" --save-prefs

# get more warnings
- arduino --pref "compiler.warning_level=more" --save-prefs

install:
Expand All @@ -48,7 +66,7 @@ install:
- 'export UNIT_HDR_ENV=$(_maketestheader headertest_env.ino mcciadk_env.h ) ; echo "UNIT_HDR_ENV: " "$UNIT_HDR_ENV" ; cat "$UNIT_HDR_ENV"'
- 'export UNIT_HDR_GUID=$(_maketestheader headertest_guid.ino mcciadk_guid.h ) ; echo "UNIT_HDR_GUID: " "$UNIT_HDR_GUID" ; cat "$UNIT_HDR_GUID"'
- arduino --install-boards mcci:samd
# - arduino --install-boards mcci:stm32
- arduino --install-boards mcci:stm32

script:
#
Expand All @@ -64,8 +82,8 @@ script:

#
# *** TESTS FOR STM32L0 / Catena 4551 ****
# make sure you install the BSP above.
#
# - arduino --verify --board $(_stm32l0opts) $THISLIB/examples/header_test/header_test.ino
- arduino --verify --board $(_stm32l0opts) $MCCI_STM32_OPTS $UNIT_HDR_BASE
- arduino --verify --board $(_stm32l0opts) $MCCI_STM32_OPTS $UNIT_HDR_ENV
- arduino --verify --board $(_stm32l0opts) $MCCI_STM32_OPTS $UNIT_HDR_GUID

### end of file ###

0 comments on commit 97e20b5

Please sign in to comment.