Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
Add -coverpkg to fix test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <knqyf263@gmail.com>
  • Loading branch information
knqyf263 committed Aug 4, 2019
1 parent 0d1a009 commit 1124ff8
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Makefile
Expand Up @@ -12,7 +12,6 @@ GIT_REPOSITORY = http://github.com/git/git.git

# Coverage
COVERAGE_REPORT = coverage.txt
COVERAGE_PROFILE = profile.out
COVERAGE_MODE = atomic

ifneq ($(origin CI), undefined)
Expand All @@ -37,16 +36,7 @@ test:
test-coverage:
@cd $(WORKDIR); \
echo "" > $(COVERAGE_REPORT); \
for dir in `find . -name "*.go" | grep -o '.*/' | sort | uniq`; do \
$(GOTEST) $$dir -coverprofile=$(COVERAGE_PROFILE) -covermode=$(COVERAGE_MODE); \
if [ $$? != 0 ]; then \
exit 2; \
fi; \
if [ -f $(COVERAGE_PROFILE) ]; then \
cat $(COVERAGE_PROFILE) >> $(COVERAGE_REPORT); \
rm $(COVERAGE_PROFILE); \
fi; \
done; \
$(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./...

clean:
rm -rf $(GIT_DIST_PATH)

0 comments on commit 1124ff8

Please sign in to comment.