From: Oren Ben-Kiki Date: Mon, 28 Aug 2017 05:21:31 +0000 (+0300) Subject: Have tests clean up the log file on success. X-Git-Tag: 0.12.0~3^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46f62ae90b91cc2fca2f1dcee248959f0765a680;p=check Have tests clean up the log file on success. --- diff --git a/tests/test_env_max_msg_size.sh b/tests/test_env_max_msg_size.sh index 0feaed5..97c21e9 100755 --- a/tests/test_env_max_msg_size.sh +++ b/tests/test_env_max_msg_size.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh UNIT_TEST=./check_set_max_msg_size -MAX_MESSAGE_LOG_FILE=${UNIT_TEST}.output +MAX_MESSAGE_LOG_FILE=${UNIT_TEST}.env.output TOO_LONG_MESSAGE="Message string too long" # This test reduces the maximal message size using the environment variable, @@ -17,8 +17,10 @@ NUM_TOO_LONG_MESSAGES=$(grep "${TOO_LONG_MESSAGE}" ${MAX_MESSAGE_LOG_FILE} | wc if test ${NUM_TOO_LONG_MESSAGES} -gt 0; then echo "Maximal message size was reduced." + rm -f ${MAX_MESSAGE_LOG_FILE} exit 0 else echo "ERROR: Maximal message size was not reduced." + echo "Test output was preserved in ${MAX_MESSAGE_LOG_FILE}" exit 1 fi diff --git a/tests/test_set_max_msg_size.sh b/tests/test_set_max_msg_size.sh index 92a5b49..830fb12 100755 --- a/tests/test_set_max_msg_size.sh +++ b/tests/test_set_max_msg_size.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh UNIT_TEST=./check_set_max_msg_size -MAX_MESSAGE_LOG_FILE=${UNIT_TEST}.output +MAX_MESSAGE_LOG_FILE=${UNIT_TEST}.set.output TOO_LONG_MESSAGE="Message string too long" # This test reduces the maximal message size using the provided function, @@ -15,8 +15,10 @@ NUM_TOO_LONG_MESSAGES=$(grep "${TOO_LONG_MESSAGE}" ${MAX_MESSAGE_LOG_FILE} | wc if test ${NUM_TOO_LONG_MESSAGES} -gt 0; then echo "Maximal message size was reduced." + rm -f ${MAX_MESSAGE_LOG_FILE} exit 0 else echo "ERROR: Maximal message size was not reduced." + echo "Test output was preserved in ${MAX_MESSAGE_LOG_FILE}" exit 1 fi