forked from dexloom/loom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
141 lines (116 loc) · 3.08 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Define the RUSTFLAGS to treat warnings as errors
RELEASEFLAGS = -D warnings -C target-cpu=native
#### Targets ####
## All targets
# Target to build the project
.PHONY: build
build:
cargo build --all
# Build release
.PHONY: release
release:
export RELEASEFLAGS | cargo build --release
# Build optimized release
.PHONY: maxperf
maxperf:
export RELEASEFLAGS | cargo build --profile maxperf
## Exex gRPC node
# Target to build the Exex gRPC node
.PHONY: build-exex-node
build-exex-node:
cargo build --bin exex-grpc-node
# Build release for Exex gRPC node
.PHONY: release-exex-node
release-exex-node:
export RELEASEFLAGS | cargo build --bin exex-grpc-node --release
# Build optimized release of Exex gRPC node
.PHONY: maxperf-exex-node
maxperf-exex-node:
export RELEASEFLAGS | cargo build --bin exex-grpc-node --profile maxperf
## Development commands
# Target to run all tests
.PHONY: test
test:
cargo test --all --all-features
# Target to run all benchmarks
.PHONY: clean
clean:
cargo clean
# Target to run all benchmarks
.PHONY: bench
bench:
cargo bench
# Target to run cargo clippy
.PHONY: clippy
clippy:
cargo clippy --all-targets --all-features -- -D warnings
# format loom
.PHONY: fmt
fmt:
cargo +stable fmt --all
# check files format fmt
.PHONY: fmt-check
fmt-check:
cargo +stable fmt --all --check
# format toml
.PHONY: taplo
taplo:
taplo format
# check files format with taplo
.PHONY: taplo-check
taplo-check:
taplo format --check
# check licences
.PHONY: deny-check
deny-check:
cargo deny --all-features check
# check files format with fmt and clippy
.PHONY: pre-release
pre-release:
cargo +stable fmt --all --check
cargo clippy --all-targets --all-features -- -D warnings
taplo format --check
# replayer test
.PHONY: replayer
replayer:
@echo "Running Replayer test case: $(FILE)\n"
@RL=${RL:-info}; \
RUST_LOG=$(RL) cargo run --package replayer --bin replayer --; \
EXIT_CODE=$$?; \
if [ $$EXIT_CODE -ne 0 ]; then \
echo "\n\033[0;31mError: Replayer tester exited with code $$EXIT_CODE\033[0m\n"; \
else \
echo "\n\033[0;32mReplayer test passed successfully.\033[0m"; \
fi
# swap tests with loom_anvil
.PHONY: swap-test
swap-test:
@echo "Running anvil swap test case: $(FILE)\n"
@RL=${RL:-info}; \
RUST_LOG=$(RL) cargo run --package loom_anvil --bin loom_anvil -- --config $(FILE); \
EXIT_CODE=$$?; \
if [ $$EXIT_CODE -ne 0 ]; then \
echo "\n\033[0;31mError: Anvil swap tester exited with code $$EXIT_CODE\033[0m\n"; \
exit 1; \
else \
echo "\n\033[0;32mAnvil swap test passed successfully.\033[0m"; \
fi
.PHONY: swap-test-1
swap-test-1: FILE="./bin/loom_anvil/test_18498188.toml"
swap-test-1: swap-test
.PHONY: swap-test-2
swap-test-2: FILE="./bin/loom_anvil/test_18567709.toml"
swap-test-2: swap-test
.PHONY: swap-test-3
swap-test-3: FILE="./bin/loom_anvil/test_19101578.toml"
swap-test-3: swap-test
.PHONY: swap-test-4
swap-test-4:FILE="./bin/loom_anvil/test_19109955.toml"
swap-test-4: swap-test
.PHONY: swap-test-all
swap-test-all: RL=off
swap-test-all:
@$(MAKE) swap-test-1 RL=$(RL)
@$(MAKE) swap-test-2 RL=$(RL)
@$(MAKE) swap-test-3 RL=$(RL)
@$(MAKE) swap-test-4 RL=$(RL)