2022-06-16 04:45:15 +00:00
|
|
|
BIN = $(GOPATH)/bin
|
|
|
|
|
|
|
|
## Mockgen tool
|
|
|
|
MOCKGEN = $(BIN)/mockgen
|
|
|
|
$(BIN)/mockgen:
|
|
|
|
go install github.com/golang/mock/mockgen@v1.6.0
|
|
|
|
|
2022-01-11 23:49:04 +00:00
|
|
|
MOCKS_DIR = $(CURDIR)/mocks
|
|
|
|
|
2022-05-26 10:20:42 +00:00
|
|
|
.PHONY: mocks test
|
2022-01-11 23:49:04 +00:00
|
|
|
|
2022-06-16 04:45:15 +00:00
|
|
|
mocks: $(MOCKGEN) mocks/snapshot/publisher.go
|
2022-01-11 23:49:04 +00:00
|
|
|
|
|
|
|
mocks/snapshot/publisher.go: pkg/types/publisher.go
|
2022-06-16 04:45:15 +00:00
|
|
|
$(MOCKGEN) -package snapshot_mock -destination $@ -source $< Publisher Tx
|
2022-01-11 23:49:04 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f mocks/snapshot/publisher.go
|
2022-05-23 11:26:48 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
go fmt ./...
|
|
|
|
go build
|
2022-05-26 10:20:42 +00:00
|
|
|
|
|
|
|
test: mocks
|
2022-06-15 07:21:26 +00:00
|
|
|
go clean -testcache && go test -p 1 -v ./...
|
|
|
|
|
|
|
|
dbtest: mocks
|
|
|
|
go clean -testcache && TEST_WITH_DB=true go test -p 1 -v ./...
|