/
Makefile
26 lines (21 loc) · 969 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
NAME := get-started
MOCKGEN_BUILD_FLAGS ?= -mod=mod
GO ?= go
GO_ENV ?= GOPRIVATE="github.com/hbl-ngocnd1/dictionary"
deploy:
ibmcloud cf push
go.list:
go list -json -m all > go.list
mockgen:
mockgen -build_flags=$(MOCKGEN_BUILD_FLAGS) -destination=./services/mock_services/mock_dictionary.go github.com/hbl-ngocnd1/dictionary/services DictionaryService
mockgen -build_flags=$(MOCKGEN_BUILD_FLAGS) -destination=./services/mock_services/mock_translate.go github.com/hbl-ngocnd1/dictionary/services TranslateService
mockgen -build_flags=$(MOCKGEN_BUILD_FLAGS) -destination=./usecase/mock_usecase/mock_dictionary.go github.com/hbl-ngocnd1/dictionary/usecase DictUseCase
.PHONY: test
test: FLAGS ?= -parallel 3
test:
$(GO_ENV) CI_TEST=test $(GO) test $(FLAGS) ./... -cover
coverage.out:
go test -v -covermode=count -coverprofile=coverage.out ./...
html_coverage.out:
go test -v -covermode=count -coverprofile=coverage.out ./...
go tool cover -html=coverage.out