Files
go-cuckoo/Makefile
M.V. Hutz afd3472d1d
Some checks failed
CI / Makefile Lint (pull_request) Successful in 20s
CI / Go Lint (pull_request) Successful in 17s
CI / Unit Tests (pull_request) Successful in 14s
CI / Mutation Tests (pull_request) Failing after 13s
CI / Fuzz Tests (pull_request) Successful in 1m13s
ci: enforce 100% mutation coverage
This will strongly indicate whether the test cases actually cover.
2026-03-19 21:20:18 -04:00

44 lines
1.4 KiB
Makefile

.PHONY: all help install clean test-unit test-mutation test-fuzz test docs lint-go lint-makefile lint
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | awk -F ':.*## ' '{printf " %-15s %s\n", $$1, $$2}'
install: ## Install dev tools
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/checkmake/checkmake/cmd/checkmake@latest
go install github.com/go-gremlins/gremlins/cmd/gremlins@latest
go install golang.org/x/tools/cmd/godoc@latest
go install golang.org/x/vuln/cmd/govulncheck@latest
test-unit: ## Run unit tests with coverage
go test ./... -cover -v
test-mutation: ## Run mutation tests with gremlins
gremlins unleash --threshold 1.0
FUZZ_TIME ?= 30
test-fuzz: ## Run all fuzz tests for 30s each
@for func in $$(grep -r --include='*_test.go' -oh 'func Fuzz\w*' . | sed 's/func //'); do \
echo "Fuzzing $$func..."; \
go test ./... -fuzz="^$$func$$" -fuzztime=$(FUZZ_TIME)s; \
done
test: test-unit test-mutation test-fuzz ## Run all tests
lint-go: ## Lint Go code
golangci-lint run ./...
lint-makefile: ## Lint the Makefile
checkmake Makefile
lint: lint-go lint-makefile ## Lint all code
docs: ## Serve godoc locally
@echo ">>> Visit: http://localhost:6060/pkg/$$(go list -m)"
godoc -http=:6060
clean: ## Clean build and test caches
go clean -cache -testcache
all: lint test ## Run all checks and tests