mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(tests): try to get code coverage from all packages
This commit is contained in:
4
Makefile
4
Makefile
@@ -167,9 +167,7 @@ benchmark-go:
|
||||
|
||||
.PHONY: test-go
|
||||
test-go:
|
||||
GO111MODULE=on go test \
|
||||
-cover -coverprofile=coverage.txt -covermode=atomic \
|
||||
./...
|
||||
GO111MODULE=on scripts/gocover.sh
|
||||
|
||||
.PHONY: test-js
|
||||
test-js: .build/deps-build-node.ok
|
||||
|
||||
16
scripts/gocover.sh
Executable file
16
scripts/gocover.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "" > coverage.txt
|
||||
|
||||
for d in $(go list ./... | grep -v github.com/prymitive/karma/internal/mapper); do
|
||||
go test \
|
||||
-coverprofile=profile.out \
|
||||
-coverpkg=$(go list ./... | grep -v github.com/prymitive/karma/internal/mapper | tr '\n' ',') \
|
||||
$d 2>&1 | grep -v 'warning: no packages being tested depend on matches for pattern'
|
||||
if [ -f profile.out ]; then
|
||||
cat profile.out >> coverage.txt
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user