-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (43 loc) · 1.34 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
45
46
47
48
49
.PHONY: default
default: help
.PHONY: start
## Run the CLI tool
start:
@go run main.go
.PHONY: unit-tests
## Run Unit Tests
unit-tests:
go test -coverprofile=coverage_unit.out -cover ./... -tags unit_test
go tool cover -html coverage_unit.out -o coverage_unit.html
.PHONY: integration-tests
## Run Integration Tests
integration-tests:
go test -coverprofile=coverage_int.out -cover ./... -tags integration_test
go tool cover -html coverage_int.out -o coverage_int.html
.PHONY: e2e-tests
## Run E2E Tests
e2e-tests:
go test -coverprofile=coverage_e2e.out -cover ./... -tags e2e_test
go tool cover -html coverage_e2e.out -o coverage_e2e.html
.PHONY: run-test-suite
## Run Complete Test Suite
run-test-suite: unit-tests integration-tests e2e-tests
help:
@echo "----------------------------------"
@echo "Welcome to make! Enjoy the flight."
@echo "Makefile - make [\033[38;5;154mtarget\033[0m]"
@echo "----------------------------------"
@echo
@echo "Targets:"
@awk '/^[a-zA-z\-_0-9%:\\]+/ { \
description = match(descriptionLine, /^## (.*)/); \
if (description) { \
target = $$1; \
description = substr(descriptionLine, RSTART + 3, RLENGTH); \
gsub("\\\\", "", target); \
gsub(":+$$", "", target); \
printf " \033[38;5;154m%-25s\033[0m %s\n", target, description; \
} \
} \
{ descriptionLine = $$0 }' $(MAKEFILE_LIST)
@printf "\n"