Subversion Repositories Tronxy-X3A-Marlin

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ron 1
#!/usr/bin/env bash
2
#
3
# travis_at_home
4
#
5
# Run all Travis test builds at home to save time finding typos
6
# Make sure to have 'arduino' somewhere in your PATH
7
#
8
 
9
LOG="travis-out.txt"
10
 
11
cd `dirname "$0"`/../..
12
 
13
TRAVIS_BUILD_DIR=`pwd`
14
echo $'Tests for '$TRAVIS_BUILD_DIR$' ...\n' >"$LOG"
15
 
16
# Add a temporary execution PATH
17
export PATH="./buildroot/bin:$PATH"
18
 
19
# Scan .travis.yml and run config/build commands only
20
X=1
21
while read P; do
22
 
23
  # Command lines start with a hyphen
24
  if [[ $P =~ ^-\ (([^ ]+)(\ .*)?)$ ]]; then
25
    WORD="${BASH_REMATCH[2]}" ; # The first word
26
    CMD="${BASH_REMATCH[1]}" ; # The whole command
27
    RUN=1 ; BUILD=0
28
    case "$WORD" in
29
      cp|opt_*|pins_*|use_*|restore_*|gen*) ;;
30
      build_*) BUILD=1 ;;
31
      *) RUN=0 ;;
32
    esac
33
 
34
    # Runnable command
35
    if [[ $RUN == 1 ]]; then
36
      echo "$CMD" >>"$LOG"
37
      RESULT=$( eval "$CMD >>\"$LOG\" 2>&1" )
38
      if [[ $BUILD == 1 ]]; then
39
        echo "--- Build $X done."
40
        echo >>"$LOG"
41
        X=$((X+1))
42
      fi
43
    fi
44
  fi
45
done <.travis.yml
46
 
47
cd - >/dev/null