From 0b7055ae5adac13337ebe106e37f6fc488871bdb Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Thu, 13 Oct 2022 12:57:19 -0500 Subject: [PATCH] test: print gas report, and ensure evm is killed --- scripts/test | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/test b/scripts/test index 42dbf7366..c8cc60c4a 100755 --- a/scripts/test +++ b/scripts/test @@ -9,6 +9,14 @@ source $(pwd)/scripts/evm yarn build +### Cleanup +function cleanup() { + if [ "$RUN_EVM" = true ]; then + evm_kill + fi +} +trap cleanup EXIT + # Gas reporter needs to run in its own evm instance if [ "$RUN_EVM" = true ]; then evm_kill @@ -23,14 +31,7 @@ mkdir -p reports # Run using the standalone evm instance npx hardhat test --network hardhat $@ -### Cleanup - -# Exit error mode so the evm instance always gets killed -set +e -result=0 - -if [ "$RUN_EVM" = true ]; then - evm_kill +if [ "$REPORT_GAS" = true ]; then + cat reports/gas-report.log + echo "" # Gas report doesn't have a newline at the end fi - -exit $result