forked from TrueCloudLab/restic
Makefile: Split out coverage into a shell script
This commit is contained in:
parent
be8064cd97
commit
b7e1d2788b
2 changed files with 11 additions and 5 deletions
6
Makefile
6
Makefile
|
@ -49,11 +49,7 @@ test-integration: .gopath
|
|||
|
||||
all.cov: .gopath
|
||||
cd $(BASEPATH) && \
|
||||
go list ./... | \
|
||||
while read pkg; do \
|
||||
go test -covermode=count -coverprofile=$$(base64 <<< $$pkg).cov $$pkg; \
|
||||
done
|
||||
echo "mode: count" > all.cov; tail -q -n +2 *.cov >> all.cov
|
||||
./coverage_all.sh all.cov
|
||||
|
||||
env:
|
||||
@echo export GOPATH=\"$(GOPATH)\"
|
||||
|
|
10
coverage_all.sh
Executable file
10
coverage_all.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
TARGETFILE="$1"
|
||||
|
||||
go list ./... | while read pkg; do
|
||||
go test -covermode=count -coverprofile=$(base64 <<< $pkg).cov $pkg
|
||||
done
|
||||
|
||||
echo "mode: count" > $TARGETFILE
|
||||
tail -q -n +2 *.cov >> $TARGETFILE
|
Loading…
Reference in a new issue