This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
151 lines (129 loc) Β· 3.53 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
140
141
142
143
144
145
146
147
148
149
150
151
SHELL := /usr/bin/env bash
.PHONY: init
init:
./scripts/init.sh
.PHONY: check
check: check-all check-no-std check-benchmarks
.PHONY: check-all
check-all: assets
export SKIP_WASM_BUILD=1
cargo check --all
cargo check --all --tests
.PHONY: check-benchmarks
check-benchmarks: assets
export SKIP_WASM_BUILD=1
cargo check --features=runtime-benchmarks
.PHONY: check-no-std
check-no-std: assets
cargo check -p=sp-mvm --target=wasm32-unknown-unknown --no-default-features
.PHONY: bench-rename-modules
bench-rename-modules: assets
scripts/rename_modules.sh
.PHONY: clippy
clippy:
cargo clippy -p=sp-mvm -p=sp-mvm-rpc -p=sp-mvm-rpc-runtime
cargo clippy -p=sp-mvm --target=wasm32-unknown-unknown --no-default-features
.PHONY: bench
bench: assets
mkdir -p ./target/sp-bench
cargo run \
--release \
--bin pontem \
--features=runtime-benchmarks -- \
benchmark \
--dev \
-lsp_mvm=trace \
--pallet=sp_mvm \
--extrinsic='*' \
--execution=wasm \
--wasm-execution=compiled \
--steps=20 --repeat=10 \
--output=target/sp-bench
.PHONY: run-bench-groupsign
run-bench-groupsign:
mkdir -p ./target/gs-bench
./target/release/pontem \
benchmark \
--dev \
-lsp_mvm=trace \
--pallet=groupsign \
--extrinsic='*' \
--execution=wasm \
--wasm-execution=compiled \
--steps=20 --repeat=10 \
--output=target/gs-bench
.PHONY: bench-groupsign
bench-groupsign:
mkdir -p ./target/gs-bench
cargo run \
--release \
--bin pontem \
--features=runtime-benchmarks -- \
benchmark \
--dev \
-lsp_mvm=trace \
--pallet=groupsign \
--extrinsic='*' \
--execution=wasm \
--wasm-execution=compiled \
--steps=20 --repeat=10 \
--output=target/gp-bench
.PHONY: test
test: assets
export SKIP_WASM_BUILD=1
cargo test --all --no-fail-fast -- --nocapture --test-threads=1
.PHONY: run
run:
cargo run --release -- --dev --tmp -lsp_mvm=trace
.PHONY: build
build:
cargo build --release
.PHONY: clean
clean:
cargo clean
.PHONY: build-bench
build-bench: assets
export SKIP_WASM_BUILD=0
cargo build --release --features=runtime-benchmarks
.PHONY: assets
assets: pallets/sp-mvm/tests/assets/stdlib \
runtime/src/tests/assets/stdlib
# pallets/sp-mvm/tests/benchmark_assets/stdlib
.PHONY: clean-assets
clean-assets:
rm -rf \
pallets/sp-mvm/tests/assets/pont-stdlib \
pallets/sp-mvm/tests/assets/move-stdlib \
pallets/sp-mvm/tests/benchmark_assets/pont-stdlib \
pallets/sp-mvm/tests/benchmark_assets/move-stdlib \
pallets/sp-mvm/tests/benchmark_assets/build \
runtime/src/tests/assets/pont-stdlib \
runtime/src/tests/assets/move-stdlib \
git clean -dfX -- \
pallets/sp-mvm/tests
pallets/sp-mvm/tests/assets/stdlib:
cd pallets/sp-mvm/tests/assets; ./build_assets.sh
pallets/sp-mvm/tests/benchmark_assets/stdlib:
cd pallets/sp-mvm/tests/benchmark_assets; ./build_assets.sh
runtime/src/tests/assets/stdlib:
cd runtime/src/tests/assets; ./build_assets.sh
.PHONY: coverage
coverage: assets
export SKIP_WASM_BUILD=1
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"
# export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
export RUSTDOCFLAGS="-Cpanic=abort"
# cargo test -p=sp-mvm --no-fail-fast -- --test-threads=1
cargo test --no-fail-fast -- --test-threads=1
grcov . \
-s . \
--binary-path ./target/debug/ \
--guess-directory-when-missing \
--llvm \
--branch \
--ignore-not-existing \
--filter covered \
-o ./target/debug/coverage/
# to produce html report add:
# -t html