Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

More feedback on test 'harness' #508

Merged
merged 1 commit into from
Apr 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ $(DOCKER_DISTRIB):

tests:
echo "mode: count" > profile.cov
for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \
go test -tags netgo -covermode=count -coverprofile=$$dir/profile.tmp $$dir; \
if [ -f $$dir/profile.tmp ]; then \
cat $$dir/profile.tmp | tail -n +2 >> profile.cov; \
rm $$dir/profile.tmp; \
for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \
output=$$(tempfile -p cover); \
go test -tags netgo -covermode=count -coverprofile=$$output $$dir; \
if [ -f $$output ]; then \
tail -n +2 <$$output >>profile.cov; \
rm $$output; \
fi \
done
go tool cover -html=profile.cov -o=coverage.html
Expand Down