From e6418b46023b8f91ef635bfa60bfc43ee07b27ff Mon Sep 17 00:00:00 2001 From: Milo Davis Date: Sat, 7 Apr 2018 22:53:53 -0400 Subject: [PATCH] Test: minor improvements to test_lib.inc.sh - Can now set show_logs variable from outside the script - Better logging for assert_balance - bake_after can now handle quoted arguments --- src/bin_client/test/test_lib.inc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin_client/test/test_lib.inc.sh b/src/bin_client/test/test_lib.inc.sh index d08118a36..913a5713a 100755 --- a/src/bin_client/test/test_lib.inc.sh +++ b/src/bin_client/test/test_lib.inc.sh @@ -34,7 +34,7 @@ register_log() { log_files+=("$1") } -show_logs=yes +show_logs="${show_logs:-yes}" display_logs() { if [ "$show_logs" = "yes" ]; then @@ -121,6 +121,7 @@ assert_balance () { local KEY="$1" local EXPECTED_BALANCE="$2" local RESULT=$($client get balance for ${KEY}) + echo "[Asserting balance for '$KEY']" if [ "${RESULT}" != "${EXPECTED_BALANCE}" ]; then printf "Balance assertion failed for ${KEY} on line '%s'. Expected %s but got %s.\n" \ "$(caller)" "${EXPECTED_BALANCE}" "${RESULT}" @@ -155,8 +156,7 @@ init_with_transfer () { bake_after () { - local ARGS="$@" - ${ARGS} + "$@" $client bake for bootstrap1 -max-priority 512 sleep 1 }