|
@@ -1,7 +1,8 @@
|
1
|
1
|
#!/usr/bin/env bash
|
2
|
2
|
|
3
|
3
|
set -e
|
4
|
|
-echo "" > coverage.txt
|
|
4
|
+MODE=atomic
|
|
5
|
+echo "mode: $MODE" > coverage.txt
|
5
|
6
|
|
6
|
7
|
PKG=$(go list ./... | grep -v /vendor/)
|
7
|
8
|
|
|
@@ -10,9 +11,9 @@ unused $PKG
|
10
|
11
|
go test -v $PKG
|
11
|
12
|
|
12
|
13
|
for d in $PKG; do
|
13
|
|
- go test -race -coverprofile=profile.out -covermode=atomic $d
|
|
14
|
+ go test -race -coverprofile=profile.out -covermode=$MODE $d
|
14
|
15
|
if [ -f profile.out ]; then
|
15
|
|
- cat profile.out >> coverage.txt
|
|
16
|
+ cat profile.out | grep -v "^mode: " >> coverage.txt
|
16
|
17
|
rm profile.out
|
17
|
18
|
fi
|
18
|
19
|
done
|