export CGO_ENABLED := 0 STATICCHECK ?= staticcheck FUZZTIME ?= 60s GENFUZZTIME ?= 10s .PHONY: gen gen-check test race alloc poison bench fuzz xserver staticcheck vet check gen: go generate ./... gen-check: gen git diff --exit-code test: go test ./... race: CGO_ENABLED=1 go test -race ./... alloc: go test -run 'Alloc' ./... poison: go test -tags xturbo_poison ./... bench: go test -bench . -benchmem ./... # Root targets (dispatch, event decode, reply ring) get FUZZTIME; generated # packages and the generator get GENFUZZTIME. fuzz: @set -e; root=$$(go list .); for pkg in $$(go list ./...); do \ time=$(GENFUZZTIME); [ "$$pkg" = "$$root" ] && time=$(FUZZTIME); \ for t in $$(go test -list 'Fuzz.*' $$pkg | grep '^Fuzz'); do \ echo "== $$pkg $$t ($$time)"; \ go test -run '^$$' -fuzz "^$$t$$" -fuzztime $$time $$pkg; \ done; \ done xserver: PATH="$$PATH:/usr/sbin" go test -tags xserver ./... staticcheck: $(STATICCHECK) ./... vet: go vet ./... check: vet staticcheck test race alloc poison gen-check