-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
99 lines (80 loc) · 2.18 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
# Define the RUSTFLAGS to treat warnings as errors
RELEASEFLAGS = -D warnings
# Target to run all tests
.PHONY: build
build:
cargo build --all
release:
export RELEASEFLAGS | $(CARGO) build --release
# Target to run all tests
.PHONY: test
test:
cargo test --all
# 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
# check files format fmt
.PHONY: fmt-check
fmt-check:
cargo +stable fmt --all --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
# format loom
.PHONY: fmt
fmt:
cargo +stable fmt --all
# 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"; \
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)