Skip to content

Commit bf891b8

Browse files
author
naren
committed
Change test bash script to support -html coverage tool
1 parent 92d93ab commit bf891b8

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

test.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
#!/usr/bin/env bash
2-
3-
set -e
4-
echo "" > coverage.txt
5-
6-
for d in $(go list ./... | grep -v vendor); do
7-
go test -v -race -coverprofile=profile.out -covermode=atomic $d
8-
if [ -f profile.out ]; then
9-
cat profile.out >> coverage.txt
10-
rm profile.out
11-
fi
12-
done
1+
echo 'mode: atomic' > coverage.txt && go list ./... | grep -v vendor | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.txt' && rm coverage.tmp

0 commit comments

Comments
 (0)