-
Notifications
You must be signed in to change notification settings - Fork 72
/
Makefile
29 lines (28 loc) · 1005 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
COVERAGE_REPORT := coverage.txt
COVERAGE_PROFILE := profile.out
COVERAGE_MODE := atomic
test:
@echo "mode: $(COVERAGE_MODE)" > $(COVERAGE_REPORT); \
if [ -f $(COVERAGE_PROFILE) ]; then \
tail -n +2 $(COVERAGE_PROFILE) >> $(COVERAGE_REPORT); \
rm $(COVERAGE_PROFILE); \
fi; \
for dir in `go list ./... | grep -v '/tests' | grep -v '/fixtures' | grep -v '/benchmarks'`; do \
go test -v $$dir -coverprofile=$(COVERAGE_PROFILE) -covermode=$(COVERAGE_MODE); \
if [ $$? != 0 ]; then \
exit 2; \
fi; \
if [ -f $(COVERAGE_PROFILE) ]; then \
tail -n +2 $(COVERAGE_PROFILE) >> $(COVERAGE_REPORT); \
rm $(COVERAGE_PROFILE); \
fi; \
done; \
go install ./generator/...; \
rm ./tests/kallax.go ; \
go generate ./tests/...; \
git diff --no-prefix -U1000; \
if [ `git status | grep 'Changes not staged for commit' | wc -l` != '0' ]; then \
echo 'There are differences between the commited tests/kallax.go and the one generated right now'; \
exit 2; \
fi; \
go test -v ./tests/...;