forked from simonshyu/notary-gcr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (38 loc) · 802 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
# Go Options
MODULE := github.com/autonomic-ai/notary-gcr
LDFLAGS := -w -s
COVEROUT := ./coverage.out
# go cover test variables
PKGS ?= $(shell go list ./... | grep -v /vendor/ | tr '\n' ' ')
# Go env vars
export GO111MODULE=on
export CGO_ENABLED=1
# Verbose output
ifdef VERBOSE
V = -v
endif
all: clean fmt_check test test_with_coverage
# Run tests on all non-vendor directories
.PHONY: test
test: TESTOPTS =
test:
@echo "+ $@ $(TESTOPTS)"
@echo
$(eval TAGS += integration)
go test $(V) \
-tags="$(TAGS)" \
-count=1 \
--race \
-covermode=atomic \
-coverprofile=$(COVEROUT) \
$(PKGS)
# Check for code well-formedness
fmt_check:
./ci/format.sh
# Test and generate coverage
test_with_coverage:
./ci/test.sh
# Clean up everything
.PHONY: clean
clean:
rm -f *.cov