2024-05-15 23:15:00 +00:00
|
|
|
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
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"
|
|
|
|
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
|
|
|
|
install:
|
|
|
|
go get gortc.io/api
|
|
|
|
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
|
|
|
test-integration:
|
|
|
|
@cd e2e && bash ./test.sh
|
2024-05-15 23:15:00 +00:00
|
|
|
prepush: test lint test-integration
|
2022-03-10 09:44:48 +00:00
|
|
|
check-api:
|
|
|
|
@cd api && bash ./check.sh
|
|
|
|
test:
|
|
|
|
@./go.test.sh
|
|
|
|
clean:
|