forked from google/go-github
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·34 lines (27 loc) · 842 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#/ script/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation.
#/ "-race -covermode atomic ./..." is used when no arguments are given.
#/
#/ When UPDATE_GOLDEN is set, all directories named "golden" are removed before running tests.
set -e
CDPATH="" cd -- "$(dirname -- "$0")/.."
# TODO(gmlewis): Remove this when #3409 is resolved.
export GODEBUG=httpmuxgo121=1
if [ "$#" = "0" ]; then
set -- -race -covermode atomic ./...
fi
if [ -n "$UPDATE_GOLDEN" ]; then
find . -name golden -type d -exec rm -rf {} +
fi
MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)"
for dir in $MOD_DIRS; do
[ "$dir" = "example/newreposecretwithlibsodium" ] && continue
echo "testing $dir"
(
cd "$dir"
go test "$@"
) || FAILED=1
done
if [ -n "$FAILED" ]; then
exit 1
fi