-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
44 lines (34 loc) · 1.13 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
PHONY: clean
.DEFAULT_GOAL := help
help:
$(info available targets:)
@awk '/^[a-zA-Z\-\_0-9\.\$$\(\)\%/]+:/ { \
helpMsg = $$0; \
nb = sub(/^[^:]*:.* ## /, "", helpMsg); \
if (nb) \
print $$1 "\t" helpMsg; \
}' \
$(MAKEFILE_LIST) | column -ts $$'\t' | \
grep --color '^[^ ]*'
COV := cover.out
DIR := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
IMPORT_PATH := github.com/cleardataeng/aidews
PROJECT_NAME = $(notdir $(CURDIR))
include mock.mk
clean: clean-mocks ## clean up artifacts
coverage-browser: $(COV) ## open coverage report in browser
go tool cover -html=$(COV)
coverage-deps: ## installs gocoverutil for checking coverage of full lib
go get -u github.com/AlekSi/gocoverutil
test: mocks ## run unit tests
go test ./... -v
test-deps:
go get -v ./...
go get github.com/golang/mock/gomock
go get github.com/golang/mock/mockgen
test-integration: ## run unit and integration tests
@#go test ./lib/... -v -tags integration
@echo "No integration tests to run"
$(COV): coverage-deps mocks ## build coverage report
gocoverutil -coverprofile=$(COV) test $(IMPORT_PATH)/lib/...
sed -i '/mock/d' $(COV)