diff --git a/src/tests/test_zksync_cli.sh b/src/tests/test_zksync_cli.sh index 58f81966..efde94c2 100755 --- a/src/tests/test_zksync_cli.sh +++ b/src/tests/test_zksync_cli.sh @@ -2,16 +2,16 @@ declare -i counter_failed=0 declare -i counter_total=0 +declare -i RESULT=0 verify_result () { - RESULT=$? counter_total+=1 if [ $RESULT -eq 0 ]; then - echo "" + echo "\n\n" echo "-----------> SUCCESS <-----------" echo "---------------------------------" else - echo "" + echo "\n\n" echo "-----------> FAILED <-----------" echo "---------------------------------" counter_failed+=1 @@ -29,6 +29,7 @@ echo "1. BASIC" echo "-----------> Basic command like zksync-cli" npx zksync-cli +RESULT=$? verify_result @@ -36,12 +37,14 @@ echo "" echo "-----------> zksync-cli -V" npx zksync-cli -V +RESULT=$? verify_result echo "" echo "-----------> zksync-cli -h" npx zksync-cli -h +RESULT=$? verify_result @@ -51,6 +54,7 @@ echo "2. DEV PART" echo "-----------> zksync-cli dev" npx zksync-cli dev +RESULT=$? verify_result @@ -58,6 +62,7 @@ echo "" echo "-----------> zksync-cli dev config" yes | npx zksync-cli dev config +RESULT=$? verify_result @@ -67,18 +72,21 @@ echo "" echo "-----------> zksync-cli dev start" npx zksync-cli dev start +RESULT=$? verify_result echo "" echo "-----------> zksync-cli dev stop" npx zksync-cli dev stop +RESULT=$? verify_result echo "" echo "-----------> zksync-cli dev restart" npx zksync-cli dev restart +RESULT=$? verify_result ########## @@ -87,12 +95,14 @@ echo "" echo "-----------> zksync-cli dev logs" npx zksync-cli dev logs +RESULT=$? verify_result echo "" echo "-----------> zksync-cli dev clean" npx zksync-cli dev clean +RESULT=$? verify_result #echo "" @@ -120,6 +130,7 @@ echo "" echo "-----------> zksync-cli dev modules" npx zksync-cli dev modules +RESULT=$? verify_result ########## @@ -128,7 +139,7 @@ verify_result #yes | npx zksync-cli create #verify_result -if [ $RESULT_COMMON -eq 0 ]; then +if [ $counter_failed -eq 0 ]; then echo "$counter_total tests Passed" else echo "Fail. $counter_failed failed test(s)"