aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 6e0e23603c814255a995f2e825cff9456a470e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
server:
	go build -ldflags "-X main.version=$$(git describe --exact-match --tags || echo "dev" ) -X main.commit=$$(git rev-parse --short HEAD)" -o mobius-hotline-server cmd/mobius-hotline-server/main.go

.PHONY: test
test:
	go test ./... -race -shuffle=on

.PHONY: cover
cover:
	go test ./... -race -shuffle=on -coverprofile=coverage.out -covermode=atomic
	go tool cover -html=coverage.out

.PHONY: lint
lint:
	golangci-lint run

# Run each fuzz target for FUZZTIME (default 30s). Plain `go test` already replays
# committed seed corpora; this exercises new random inputs.
.PHONY: fuzz
fuzz:
	@for target in $$(go test ./hotline -list 'Fuzz.*' | grep '^Fuzz'); do \
		echo "fuzzing $$target"; \
		go test ./hotline -run '^$$' -fuzz "^$$target$$" -fuzztime $${FUZZTIME:-30s} || exit 1; \
	done