diff options
| author | Palmer Dabbelt <palmer@dabbelt.com> | 2017-06-08 09:58:00 -0700 | 
|---|---|---|
| committer | Palmer Dabbelt <palmer@dabbelt.com> | 2017-06-08 10:22:35 -0700 | 
| commit | 30f7ed1019841ef177bdeceebe62ce927f05c81a (patch) | |
| tree | 8ad53bb8eebc59a1bb578386fc47cd4f906d9246 | |
| parent | b7436b281e0f20fdc5f9e538176b439b578315f8 (diff) | |
Add a simple regression script
| -rwxr-xr-x | regression.bash | 71 | ||||
| -rw-r--r-- | software/coremark/.unsupported-boards | 6 | ||||
| -rw-r--r-- | software/double_tap_dontboot/.unsupported-boards | 3 | ||||
| -rw-r--r-- | software/led_fade/.unsupported-boards | 3 | 
4 files changed, 83 insertions, 0 deletions
diff --git a/regression.bash b/regression.bash new file mode 100755 index 0000000..da8bf10 --- /dev/null +++ b/regression.bash @@ -0,0 +1,71 @@ +#!/bin/bash + +unset board +unset manual +while [[ "$1" != "" ]] +do +  case "$1" in +  "--board") +    board="$2" +    shift +    shift +    ;; +  "--manual") +    manual="true" +    shift +    ;; +  esac +done + +if [[ "$board" == "" ]] +then +  echo "Specify a --board to test" >&2 +  exit 1 +fi + +if [[ "$manual" == "true" ]] +then +  echo "You're running in manual test mode.  Please connect a $board to continue..." +  read -p "Press ENTER to continue" +fi + +set -e + +find software -mindepth 1 -maxdepth 2 -type d | cut -d/ -f2 | while read program +do +  # Allow examples to specify the boards on which they won't run. +  if test -f software/$program/.unsupported-boards +  then +    if grep -q $board software/$program/.unsupported-boards +    then +      continue +    fi +  fi + +  # Build the example. +  make BOARD=$board PROGRAM=$program software + +  # We require user interaction in order to verify the tests succeed.  If the +  # user hasn't specified the manual flag then don't bother running the tests. +  if [[ "$manual" == "true" ]] +  then +    echo "We're about to run $program on $board, waiting 10 seconds" +    sleep 1s + +    echo "flashing $program" +    make BOARD=$board PROGRAM=$program upload + +    echo "$program has been flashed to your $board, please test it.  GDB will open in 2 seconds" +    urxvt -hold -e make BOARD=$board PROGRAM=$program run_openocd & +    sleep 2s +    urxvt -hold -e make BOARD=$board PROGRAM=$program run_gdb + +    echo "Close the running OpenOCD" +    wait +  fi +done + +if [[ "$manual" != "true" ]] +then +  echo "You haven't actually verified the tests run, please don't release!" >&2 +fi diff --git a/software/coremark/.unsupported-boards b/software/coremark/.unsupported-boards new file mode 100644 index 0000000..9221334 --- /dev/null +++ b/software/coremark/.unsupported-boards @@ -0,0 +1,6 @@ +# We don't deliver the full coremark sources for license reasons, so this can't +# run in regression. +freedom-e300-hifive1 +freedom-e300-arty +coreplexip-e31-arty +coreplexip-e51-arty diff --git a/software/double_tap_dontboot/.unsupported-boards b/software/double_tap_dontboot/.unsupported-boards new file mode 100644 index 0000000..4e93148 --- /dev/null +++ b/software/double_tap_dontboot/.unsupported-boards @@ -0,0 +1,3 @@ +coreplexip-e31-arty +coreplexip-e51-arty + diff --git a/software/led_fade/.unsupported-boards b/software/led_fade/.unsupported-boards new file mode 100644 index 0000000..4e93148 --- /dev/null +++ b/software/led_fade/.unsupported-boards @@ -0,0 +1,3 @@ +coreplexip-e31-arty +coreplexip-e51-arty +  | 
