1 #!/bin/bash 2 # 3 # A basic coverage script 4 # Usage : 5 # coverage.bash COVERAGE-COMMAND 6 # Where COVERAGE-COMMAND is the command for 7 # coverage program 8 9 set -eu 10 11 export COV=$1 12 13 function header_print { 14 15 echo 16 echo "-------------------------------------------------" 17 echo " Running test $@" 18 echo "-------------------------------------------------" 19 echo 20 } 21 22 function first_run_test { 23 24 header_print $@ 25 ${COV} run ../versions/versions.py $@ 26 27 } 28 29 30 function run_test { 31 32 header_print $@ 33 ${COV} run -a ../versions/versions.py $@ 34 35 } 36 37 first_run_test -d -f coverage.yaml 38 run_test -d -f doesnotexist.yaml 39 run_test -l -f coverage.yaml 40 run_test -f bad_formatted.yaml 41 run_test -f versions.yaml 42 run_test -l -f versions.yaml