2022-03-10 09:44:48 +00:00
|
|
|
VERSION := $(shell git describe --tags | sed -e 's/^v//g' | awk -F "-" '{print $$1}')
|
|
|
|
ITERATION := $(shell git describe --tags --long | awk -F "-" '{print $$2}')
|
|
|
|
GO_VERSION=$(shell gobuild -v)
|
|
|
|
GO := $(or $(GOROOT),/usr/lib/go)/bin/go
|
|
|
|
PROCS := $(shell nproc)
|
|
|
|
cores:
|
|
|
|
@echo "cores: $(PROCS)"
|
|
|
|
bench:
|
|
|
|
go test -bench .
|
|
|
|
bench-record:
|
|
|
|
$(GO) test -bench . > "benchmarks/stun-go-$(GO_VERSION).txt"
|
2024-01-18 18:54:54 +00:00
|
|
|
fuzz-prepare-msg:
|
|
|
|
go-fuzz-build -func FuzzMessage -o stun-msg-fuzz.zip github.com/pion/stun
|
|
|
|
fuzz-prepare-typ:
|
|
|
|
go-fuzz-build -func FuzzType -o stun-typ-fuzz.zip github.com/pion/stun
|
|
|
|
fuzz-prepare-setters:
|
|
|
|
go-fuzz-build -func FuzzSetters -o stun-setters-fuzz.zip github.com/pion/stun
|
|
|
|
fuzz-msg:
|
|
|
|
go-fuzz -bin=./stun-msg-fuzz.zip -workdir=fuzz/stun-msg
|
|
|
|
fuzz-typ:
|
|
|
|
go-fuzz -bin=./stun-typ-fuzz.zip -workdir=fuzz/stun-typ
|
|
|
|
fuzz-setters:
|
|
|
|
go-fuzz -bin=./stun-setters-fuzz.zip -workdir=fuzz/stun-setters
|
|
|
|
fuzz-test:
|
|
|
|
go test -tags gofuzz -run TestFuzz -v .
|
|
|
|
fuzz-reset-setters:
|
|
|
|
rm -f -v -r stun-setters-fuzz.zip fuzz/stun-setters
|
2022-03-10 09:44:48 +00:00
|
|
|
lint:
|
|
|
|
@golangci-lint run ./...
|
|
|
|
@echo "ok"
|
|
|
|
escape:
|
|
|
|
@echo "Not escapes, except autogenerated:"
|
|
|
|
@go build -gcflags '-m -l' 2>&1 \
|
|
|
|
| grep -v "<autogenerated>" \
|
|
|
|
| grep escapes
|
|
|
|
format:
|
|
|
|
goimports -w .
|
|
|
|
bench-compare:
|
|
|
|
go test -bench . > bench.go-16
|
|
|
|
go-tip test -bench . > bench.go-tip
|
|
|
|
@benchcmp bench.go-16 bench.go-tip
|
2024-01-18 18:54:54 +00:00
|
|
|
install-fuzz:
|
|
|
|
go get -u github.com/dvyukov/go-fuzz/go-fuzz-build
|
|
|
|
go get github.com/dvyukov/go-fuzz/go-fuzz
|
2022-03-10 09:44:48 +00:00
|
|
|
install:
|
|
|
|
go get gortc.io/api
|
|
|
|
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
2024-01-18 18:54:54 +00:00
|
|
|
docker-build:
|
|
|
|
docker build -t pion/stun .
|
2022-03-10 09:44:48 +00:00
|
|
|
test-integration:
|
|
|
|
@cd e2e && bash ./test.sh
|
2024-01-18 18:54:54 +00:00
|
|
|
prepush: assert test lint test-integration
|
2022-03-10 09:44:48 +00:00
|
|
|
check-api:
|
|
|
|
@cd api && bash ./check.sh
|
2024-01-18 18:54:54 +00:00
|
|
|
assert:
|
|
|
|
bash .github/assert-contributors.sh
|
|
|
|
bash .github/lint-disallowed-functions-in-library.sh
|
|
|
|
bash .github/lint-commit-message.sh
|
2022-03-10 09:44:48 +00:00
|
|
|
test:
|
|
|
|
@./go.test.sh
|
|
|
|
clean:
|