-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (32 loc) · 1.05 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
APP_NAME = r3x-cli
ORG_NAME = rubixFunctions
PKG = github.com/$(ORG_NAME)/$(APP_NAME)
TOP_SRC_DIRS = cmd
PACKAGES ?= $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*_test.go \
-exec dirname {} \\; | sort | uniq")
.PHONY: test-all
test-all: test-unit
make test-integration
.PHONY: test
test: test-unit
.PHONY: test-unit
test-unit:
@echo Running tests:
GOCACHE=off go test -cover \
$(addprefix $(PKG)/,$(PACKAGES))
.PHONY: test-integration
test-integration:
@echo Running tests:
GOCACHE=off go test -failfast -cover -tags=integration \
$(addprefix $(PKG)/,$(PACKAGES))
.PHONY: test-integration-cover
test-integration-cover:
echo "mode: count" > coverage-all.out
GOCACHE=off $(foreach pkg,$(PACKAGES),\
go test -failfast -tags=integration -coverprofile=coverage.out -covermode=count $(addprefix $(PKG)/,$(pkg)) || exit 1;\
tail -n +2 coverage.out >> coverage-all.out;)
make cleanup-coverage-file
.PHONY: cleanup-coverage-file
cleanup-coverage-file:
@echo "Cleaning up output of coverage report"
./scripts/cleanup-coverage-file.sh