Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. VERSION := $(shell git describe --tags | sed -e 's/^v//g' | awk -F "-" '{print $$1}')
  2. ITERATION := $(shell git describe --tags --long | awk -F "-" '{print $$2}')
  3. GO_VERSION=$(shell gobuild -v)
  4. GO := $(or $(GOROOT),/usr/lib/go)/bin/go
  5. PROCS := $(shell nproc)
  6. cores:
  7. @echo "cores: $(PROCS)"
  8. bench:
  9. go test -bench .
  10. bench-record:
  11. $(GO) test -bench . > "benchmarks/stun-go-$(GO_VERSION).txt"
  12. fuzz-prepare-msg:
  13. go-fuzz-build -func FuzzMessage -o stun-msg-fuzz.zip github.com/pion/stun
  14. fuzz-prepare-typ:
  15. go-fuzz-build -func FuzzType -o stun-typ-fuzz.zip github.com/pion/stun
  16. fuzz-prepare-setters:
  17. go-fuzz-build -func FuzzSetters -o stun-setters-fuzz.zip github.com/pion/stun
  18. fuzz-msg:
  19. go-fuzz -bin=./stun-msg-fuzz.zip -workdir=fuzz/stun-msg
  20. fuzz-typ:
  21. go-fuzz -bin=./stun-typ-fuzz.zip -workdir=fuzz/stun-typ
  22. fuzz-setters:
  23. go-fuzz -bin=./stun-setters-fuzz.zip -workdir=fuzz/stun-setters
  24. fuzz-test:
  25. go test -tags gofuzz -run TestFuzz -v .
  26. fuzz-reset-setters:
  27. rm -f -v -r stun-setters-fuzz.zip fuzz/stun-setters
  28. lint:
  29. @golangci-lint run ./...
  30. @echo "ok"
  31. escape:
  32. @echo "Not escapes, except autogenerated:"
  33. @go build -gcflags '-m -l' 2>&1 \
  34. | grep -v "<autogenerated>" \
  35. | grep escapes
  36. format:
  37. goimports -w .
  38. bench-compare:
  39. go test -bench . > bench.go-16
  40. go-tip test -bench . > bench.go-tip
  41. @benchcmp bench.go-16 bench.go-tip
  42. install-fuzz:
  43. go get -u github.com/dvyukov/go-fuzz/go-fuzz-build
  44. go get github.com/dvyukov/go-fuzz/go-fuzz
  45. install:
  46. go get gortc.io/api
  47. go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
  48. docker-build:
  49. docker build -t pion/stun .
  50. test-integration:
  51. @cd e2e && bash ./test.sh
  52. prepush: assert test lint test-integration
  53. check-api:
  54. @cd api && bash ./check.sh
  55. assert:
  56. bash .github/assert-contributors.sh
  57. bash .github/lint-disallowed-functions-in-library.sh
  58. bash .github/lint-commit-message.sh
  59. test:
  60. @./go.test.sh
  61. clean: