github.com/google/go-github/v57@v57.0.0/script/test.sh (about) 1 #!/bin/sh 2 #/ script/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation. 3 #/ "-race -covermode atomic ./..." is used when no arguments are given. 4 #/ 5 #/ When UPDATE_GOLDEN is set, all directories named "golden" are removed before running tests. 6 7 set -e 8 9 CDPATH="" cd -- "$(dirname -- "$0")/.." 10 11 if [ "$#" = "0" ]; then 12 set -- -race -covermode atomic ./... 13 fi 14 15 if [ -n "$UPDATE_GOLDEN" ]; then 16 find . -name golden -type d -exec rm -rf {} + 17 fi 18 19 MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" 20 21 for dir in $MOD_DIRS; do 22 [ "$dir" = "example/newreposecretwithlibsodium" ] && continue 23 echo "testing $dir" 24 ( 25 cd "$dir" 26 go test "$@" 27 ) || FAILED=1 28 done 29 30 if [ -n "$FAILED" ]; then 31 exit 1 32 fi