-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (42 loc) · 964 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
packages = \
./gql \
.PHONY: install
install:
@echo Installing dependencies...
@go get ./...
.PHONY: build
build:
@echo Building binary...
@go build -v .
.PHONY: run
run: build
@echo Running Droll GraphQL API...
@if [ $(go env GOOS) == "windows" ]
@droll-api.exe
@else
@./droll-api
@fi
.PHONY: test
test:
@$(foreach package,$(packages), \
set -e; \
go test -coverprofile $(package)/cover.out -covermode=count $(package);)
clear:
@echo Cleaning all builds and test output...
@$(foreach package,$(packages), \
rm -rf *.out; \
rm -rf *.xml; \
rm -rf *.exe; \
rm -rf ./**/*.out; \
rm -rf ./**/*.xml;)
.PHONY: cover
cover:
@set -e
@echo "" > coverage.txt
@$(foreach package,$(packages), \
go test -race -coverprofile=profile.out -covermode=atomic $(package); cat profile.out >> coverage.txt)
@rm profile.out;
.PHONY: show
show:
@echo Launching web browser to show overall coverage...
@go tool cover -html=cover-all.out