-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (68 loc) · 1.8 KB
/
Makefile
File metadata and controls
86 lines (68 loc) · 1.8 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
GOFMT=$(GOCMD) fmt
GOVET=$(GOCMD) vet
GOLINT=golint
BINARY_NAME=kioshun
PACKAGE_NAME=github.com/unkn0wn-root/kioshun
.PHONY: all
all: test build
.PHONY: build
build:
$(GOBUILD) -v ./...
.PHONY: test
test:
$(GOTEST) -v -race -coverprofile=coverage.out ./...
.PHONY: bench-deps
bench-deps:
cd _benchmarks && $(GOMOD) tidy && $(GOMOD) download
.PHONY: bench-runner
bench-runner: bench-deps
cd _benchmarks && timeout 600 go run benchmark_runner.go
.PHONY: bench
bench: bench-deps
cd _benchmarks && $(GOTEST) -bench=. -benchmem -run=^$$ ./...
.PHONY: bench-full
bench-full: bench-deps
cd _benchmarks && $(GOTEST) -bench=. -benchmem -benchtime=10s -run=^$$ ./...
.PHONY: bench-compare
bench-compare: bench-deps
@echo "Running performance comparison..."
cd _benchmarks && $(GOTEST) -bench=BenchmarkCacheShardComparison -benchmem -run=^$$ ./...
cd _benchmarks && $(GOTEST) -bench=BenchmarkCacheEvictionPolicyComparison -benchmem -run=^$$ ./...
.PHONY: lint
lint:
$(GOVET) ./...
$(GOLINT) ./...
.PHONY: fmt
fmt:
$(GOFMT) ./...
.PHONY: clean
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
.PHONY: tidy
tidy:
$(GOMOD) tidy
.PHONY: deps
deps:
$(GOMOD) download
.PHONY: check
check: fmt lint test
.PHONY: stress-test
stress-test: bench-deps
@echo "Running stress test..."
cd _benchmarks && $(GOTEST) -bench=BenchmarkCacheScalability -benchmem -benchtime=30s -run=^$$ ./...
.PHONY: mem-analysis
mem-analysis: bench-deps
@echo "Running memory usage analysis..."
cd _benchmarks && $(GOTEST) -bench=BenchmarkCacheMemoryUsage -benchmem -run=^$$ ./...
.PHONY: install-tools
install-tools:
$(GOGET) -u golang.org/x/lint/golint
$(GOGET) -u golang.org/x/tools/cmd/goimports
$(GOGET) -u github.com/kisielk/errcheck