forked from KarnerTh/mermerd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (27 loc) · 957 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
GIT_TAG := $(shell git describe --tags --abbrev=0)
test_target := "./..."
.PHONY: prepare-sqlite
prepare-sqlite:
rm -f mermerd_test.db
cat test/db-table-setup.sql test/sqlite/sqlite-enum-setup.sql test/sqlite/sqlite-multiple-databases.sql | sqlite3 mermerd_test.db
.PHONY: test-coverage
test-coverage:
go test -cover -coverprofile=coverage.out ./...; go tool cover -html=coverage.out -o coverage.html; rm coverage.out
# https://github.com/vektra/mockery is needed
.PHONY: create-mocks
create-mocks:
mockery --all
# https://github.com/mfridman/tparse is needed
.PHONY: test-all
test-all:
go test $(test_target) -cover -json | tparse -all
# https://github.com/mfridman/tparse is needed
.PHONY: test-unit
test-unit:
go test --short $(test_target) -cover -json | tparse -all
.PHONY: test-cleanup
test-cleanup:
go clean -testcache
.PHONY: publish-package
publish-package:
GOPROXY=proxy.golang.org go list -m github.com/KarnerTh/mermerd@$(GIT_TAG)