| 1 |
GO ?= $(shell which go) |
| 2 |
|
| 3 |
GO_PKGS ?= $(shell $(GO) list ./...) |
| 4 |
|
| 5 |
GO_TEST_PKGS ?= $(shell test -f go.mod && $(GO) list -f \ |
| 6 |
'{{ if or .TestGoFiles .XTestGoFiles }}{{ .ImportPath }}{{ end }}' \ |
| 7 |
$(GO_PKGS)) |
| 8 |
|
| 9 |
GO_TEST_TIMEOUT ?= 15s |
| 10 |
|
| 11 |
GO_BENCH=go test -bench=. -benchmem |
| 12 |
|
| 13 |
all: lint test benchmark |
| 14 |
|
| 15 |
test: |
| 16 |
$(GO) test \ |
| 17 |
-race \ |
| 18 |
-timeout $(GO_TEST_TIMEOUT) \ |
| 19 |
$(GO_TEST_PKGS) |
| 20 |
|
| 21 |
|
| 22 |
benchmark: |
| 23 |
$(GO_BENCH) |
| 24 |
cd rfc3164 && $(GO_BENCH) |
| 25 |
cd rfc5424 && $(GO_BENCH) |
| 26 |
cd parsercommon && $(GO_BENCH) |
| 27 |
|
| 28 |
lint: |
| 29 |
golangci-lint run ./... |