aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 6af89c86d172fd63c1e19b38c08283eafc7fc4fb (plain)
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
.PHONY=all test testjson vet vetjson cov covhtml clean

# build binary
all:
	go build -tags='sqlite_fts5 sqlite_json' -ldflags='-s -w'

# run all tests except long ones
test:
	go test -short -tags='sqlite_fts5 sqlite_json' -cover ./...

# run all tests except long ones, print result to stdout as json
testjson:
	go test -short -tags='sqlite_fts5 sqlite_json' -json -cover ./...

# run all tests, including long ones
testall:
	go test -tags='sqlite_fts5 sqlite_json' -cover ./...

# run all tests, print result to stdout as json
testalljson:
	go test -tags='sqlite_fts5 sqlite_json' -json -cover ./...

# run go vet
vet:
	go vet ./...

# run go vet, print results to stdout as json
vetjson:
	go vet -json ./...

# generate test coverage profile, print results to stdout
cov:
	go test -tags='sqlite_fts5 sqlite_json' -coverprofile=coverage.out ./... && \
	  go tool cover -func=coverage.out

# generate test coverage profile, render results as html, show
# in browser
covhtml:
	go test -tags='sqlite_fts5 sqlite_json' -coverprofile=coverage.out ./... && \
	  go tool cover -html=coverage.out -o coverage.html && \
    xdg-open ./coverage.html

# run go clean
clean:
	go clean