Skip to content

Commit 2bb8e60

Browse files
committed
Add new makefile
1 parent 7bf6752 commit 2bb8e60

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# general
2+
WORKDIR = $(PWD)
3+
4+
# coverage
5+
COVERAGE_REPORT = coverage.txt
6+
COVERAGE_PROFILE = profile.out
7+
COVERAGE_MODE = atomic
8+
9+
coverage:
10+
@cd $(WORKDIR); \
11+
echo "" > $(COVERAGE_REPORT); \
12+
for dir in `find . -name "*.go" | grep -o '.*/' | sort | uniq`; do \
13+
go test -v -race $$dir -coverprofile=$(COVERAGE_PROFILE) -covermode=$(COVERAGE_MODE); \
14+
if [ $$? != 0 ]; then \
15+
exit 2; \
16+
fi; \
17+
if [ -f $(COVERAGE_PROFILE) ]; then \
18+
cat $(COVERAGE_PROFILE) >> $(COVERAGE_REPORT); \
19+
rm $(COVERAGE_PROFILE); \
20+
fi; \
21+
done; \

0 commit comments

Comments
 (0)