-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
48 lines (41 loc) · 2.02 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
-include .env
# deps
update:; forge update
build :; forge build
size :; forge build --sizes
# storage inspection
inspect :; forge inspect ${contract} storage-layout --pretty
# specify which fork to use. set this in our .env
# if we want to test multiple forks in one go, remove this as an argument below
FORK_URL := ${ETH_RPC_URL} # BASE_RPC_URL, ETH_RPC_URL, ARBITRUM_RPC_URL
# if we want to run only matching tests, set that here
test := test_
# local tests without fork
test :; forge test -vv --fork-url ${FORK_URL}
trace :; forge test -vvv --fork-url ${FORK_URL}
gas :; forge test --fork-url ${FORK_URL} --gas-report
test-contract :; forge test -vv --match-contract $(contract) --fork-url ${FORK_URL}
test-contract-gas :; forge test --gas-report --match-contract ${contract} --fork-url ${FORK_URL}
trace-contract :; forge test -vvv --match-contract $(contract) --fork-url ${FORK_URL}
test-test :; forge test -vv --match-test $(test) --fork-url ${FORK_URL}
test-test-trace :; forge test -vvv --match-test $(test) --fork-url ${FORK_URL}
trace-test :; forge test -vvvvv --match-test $(test) --fork-url ${FORK_URL}
snapshot :; forge snapshot -vv --fork-url ${FORK_URL}
snapshot-diff :; forge snapshot --diff -vv --fork-url ${FORK_URL}
trace-setup :; forge test -vvvv --fork-url ${FORK_URL}
trace-max :; forge test -vvvvv --fork-url ${FORK_URL}
coverage :; forge coverage --fork-url ${FORK_URL}
coverage-report :; forge coverage --report lcov --fork-url ${FORK_URL}
coverage-debug :; forge coverage --report debug --fork-url ${FORK_URL}
coverage-html:
@echo "Running coverage..."
forge coverage --report lcov --fork-url ${FORK_URL}
@if [ "`uname`" = "Darwin" ]; then \
lcov --ignore-errors inconsistent --remove lcov.info 'src/test/**' --output-file lcov.info; \
genhtml --ignore-errors inconsistent -o coverage-report lcov.info; \
else \
lcov --remove lcov.info 'src/test/**' --output-file lcov.info; \
genhtml -o coverage-report lcov.info; \
fi
@echo "Coverage report generated at coverage-report/index.html"
clean :; forge clean