Blame | Last modification | View Log | RSS feed
#!/usr/bin/env bash## travis_at_home## Run all Travis test builds at home to save time finding typos# Make sure to have 'arduino' somewhere in your PATH#LOG="travis-out.txt"cd `dirname "$0"`/../..TRAVIS_BUILD_DIR=`pwd`echo $'Tests for '$TRAVIS_BUILD_DIR$' ...\n' >"$LOG"# Add a temporary execution PATHexport PATH="./buildroot/bin:$PATH"# Scan .travis.yml and run config/build commands onlyX=1while read P; do# Command lines start with a hyphenif [[ $P =~ ^-\ (([^ ]+)(\ .*)?)$ ]]; thenWORD="${BASH_REMATCH[2]}" ; # The first wordCMD="${BASH_REMATCH[1]}" ; # The whole commandRUN=1 ; BUILD=0case "$WORD" incp|opt_*|pins_*|use_*|restore_*|gen*) ;;build_*) BUILD=1 ;;*) RUN=0 ;;esac# Runnable commandif [[ $RUN == 1 ]]; thenecho "$CMD" >>"$LOG"RESULT=$( eval "$CMD >>\"$LOG\" 2>&1" )if [[ $BUILD == 1 ]]; thenecho "--- Build $X done."echo >>"$LOG"X=$((X+1))fififidone <.travis.ymlcd - >/dev/null