Skip to content

Commit 0b7055a

Browse files
committed
test: print gas report, and ensure evm is killed
1 parent f1c5fe7 commit 0b7055a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

scripts/test

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ source $(pwd)/scripts/evm
99

1010
yarn build
1111

12+
### Cleanup
13+
function cleanup() {
14+
if [ "$RUN_EVM" = true ]; then
15+
evm_kill
16+
fi
17+
}
18+
trap cleanup EXIT
19+
1220
# Gas reporter needs to run in its own evm instance
1321
if [ "$RUN_EVM" = true ]; then
1422
evm_kill
@@ -23,14 +31,7 @@ mkdir -p reports
2331
# Run using the standalone evm instance
2432
npx hardhat test --network hardhat $@
2533

26-
### Cleanup
27-
28-
# Exit error mode so the evm instance always gets killed
29-
set +e
30-
result=0
31-
32-
if [ "$RUN_EVM" = true ]; then
33-
evm_kill
34+
if [ "$REPORT_GAS" = true ]; then
35+
cat reports/gas-report.log
36+
echo "" # Gas report doesn't have a newline at the end
3437
fi
35-
36-
exit $result

0 commit comments

Comments
 (0)