forked from ovn-org/libovsdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 1.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.PHONY: all local test test-local integration-test-local install-deps lint fmt prebuild-local build-local
all: test
local: install-deps build-local fmt lint test-local bench-local
prebuild-local:
@echo "+ $@"
@mkdir -p bin
@go build -v -o ./bin ./cmd/modelgen
@[ -f example/play_with_ovs/ovs.ovsschema ] || curl -o example/play_with_ovs/ovs.ovsschema https://raw.githubusercontent.com/openvswitch/ovs/v2.15.0/vswitchd/vswitch.ovsschema
@go generate -v ./...
build-local: prebuild-local
@echo "+ $@"
@go build -v ./...
test-local:
@echo "+ $@"
@go test -race -coverprofile=unit.cov -short -v ./...
bench-local:
@echo "+ $@"
@go test -run=XXX -count=3 -bench=. ./... | tee bench.out
@benchstat bench.out
integration-test-local: prebuild-local
@echo "+ $@"
@go test -race -v -coverprofile=integration.cov -run Integration ./...
test:
@docker-compose pull
@docker-compose run --rm test
install-deps:
@echo "+ $@"
@golangci-lint --version
@go install golang.org/x/perf/cmd/benchstat@latest
lint:
@echo "+ $@"
@golangci-lint run
fmt:
@echo "+ $@"
@test -z "$$(gofmt -s -l . | tee /dev/stderr)"