forked from coinbase/kryptology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
112 lines (83 loc) · 2.75 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
.PHONY: all build bench clean cover deflake fmt lint test test-clean test-long
GOENV=GO111MODULE=on
GO=${GOENV} go
COVERAGE_OUT=/tmp/coverage.out
PACKAGE=./...
TEST_CLAUSE= $(if ${TEST}, -run ${TEST})
DOCTOOLS=docker run --rm -v "$$(pwd)":"$$(pwd)" -w "$$(pwd)" doctools:latest
.PHONY: all
all: githooks test build lint fmt deps docs
.PHONY: build
build:
${GO} build ./...
.PHONY: bench
bench:
${GO} test -short -bench=. -test.timeout=0 -run=^noTests ./...
.PHONY: clean
clean:
${GO} clean -cache -modcache -i -r
.PHONY: cover
cover: ## compute and display test coverage report
${GO} test -short -coverprofile=${COVERAGE_OUT} ${PACKAGE}
${GO} tool cover -html=${COVERAGE_OUT}
.PHONY: deps
deps: ## Build dockerized autodoc tools
@docker build -t doctools:latest .
.PHONY: docs
docs: ## Apply copyright headers and re-build package-level documents
@${DOCTOOLS} spdx
gen-readme-docs:
@${DOCTOOLS} gomarkdoc --output '{{.Dir}}/README.md' ./...
.PHONY: deflake
deflake: ## Runs tests many times to detect flakes
${GO} test -count=1000 -short -timeout 0 ${TEST_CLAUSE} ./...
.PHONY: fmt
fmt:
${GO} fmt ./...
.PHONY: githooks
githooks:
git config core.hooksPath .githooks
.PHONY: lint
lint:
${GO} vet ./...
golangci-lint run
.PHONY: lint-fix
lint-fix:
${GO} vet ./...
golangci-lint run --fix
.PHONY: test
test:
${GO} test -short ${TEST_CLAUSE} ./...
.PHONY: test-clean
test-clean: ## Clear test cache and force all tests to be rerun
${GO} clean -testcache && ${GO} test -count=1 -short ${TEST_CLAUSE} ./...
.PHONY: test-long
test-long: ## Runs all tests, including long-running tests
${GO} test ${TEST_CLAUSE} ./...
.PHONY: run-dkg-bls
run-dkg-bls: ## Runs test of gennaro dkg w/ BLS signature
${GO} run test/dkg/bls/main.go
.PHONY: run-dkg-ed25519
run-dkg-ed25519: ## Runs test of gennaro dkg w/ ed25519 signature
${GO} run test/dkg/ed25519/main.go
.PHONY: run-frost-dkg-bls
run-frost-dkg-bls: ## Runs test of frost dkg w/ BLS signature
${GO} run test/frost_dkg/bls/main.go
.PHONY: run-frost-dkg-ed25519
run-frost-dkg-ed25519: ## Runs test of frost dkg w/ ed25519 signature
${GO} run test/frost_dkg/ed25519/main.go
.PHONY: run-frost-dkg-ecdsa
run-frost-dkg-ecdsa: ## Runs test of frost dkg w/ ecdsa signature
${GO} run test/frost_dkg/k256/main.go
.PHONY: run-frost-full
run-frost-full: ## Runs test of frost dkg w/ frost signature
${GO} run test/frost_dkg/frost/main.go
.PHONY: run-verenc-elgamal
run-verenc-elgamal: ## Runs test of el-gamal verifiable encryption
${GO} run test/verenc/elgamal/main.go
.PHONY: run-accumulator-ecc
run-accumulator-ecc: ## Runs test of cryptographic accumulator
${GO} run test/accumulator/ecc/main.go
.PHONY: compare-bench
compare-bench: ## Runs bench on master and the current branch and compares the result
bash scripts/perf-comp-local