From ae7fce5a60397ef3300a533944d7fa91e32ec178 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 4 Sep 2015 11:31:36 +0200 Subject: [PATCH] tests: store msgmsg message for display in fail as well Git-Dch: Ignore --- test/integration/framework | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/integration/framework b/test/integration/framework index 18bfec7ed..6cba26c8d 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -66,6 +66,9 @@ msgtest() { msgprintf "${CINFO}%s" "${CCMD}%s${CINFO}" "…${CNORMAL} " "$@"; } msgpass() { printf "${CPASS}PASS${CNORMAL}\n"; } msgskip() { if [ -n "$MSGTEST_MSG" ]; then + if [ -n "$MSGTEST_MSGMSG" ]; then + echo "$MSGTEST_MSGMSG" + fi if [ -n "$MSGTEST_GRP" ] && [ "$MSGTEST_GRP" != 'NEXT' ] && [ "$MSGTEST_GRP" != "$MSGTEST_MSG" ]; then echo "Part of the test group: $MSGTEST_GRP" fi @@ -77,6 +80,9 @@ msgskip() { } msgfail() { if [ -n "$MSGTEST_MSG" ]; then + if [ -n "$MSGTEST_MSGMSG" ]; then + echo "$MSGTEST_MSGMSG" + fi if [ -n "$MSGTEST_GRP" ] && [ "$MSGTEST_GRP" != 'NEXT' ] && [ "$MSGTEST_GRP" != "$MSGTEST_MSG" ]; then echo "Part of the test group: $MSGTEST_GRP" fi @@ -114,7 +120,9 @@ if [ $MSGLEVEL -le 1 ]; then msgnwarn() { true; } fi if [ $MSGLEVEL -le 2 ]; then - msgmsg() { true; } + msgmsg() { + MSGTEST_MSGMSG="$(msgprintf "${CMSG}%s" '%s' "${CNORMAL}" "$@")" + } msgnmsg() { true; } msgtest() { MSGTEST_MSG="$(msgprintf "${CINFO}%s" "${CCMD}%s${CINFO}" "…${CNORMAL} " "$@")" @@ -1433,6 +1441,9 @@ testmarkedmanual() { msgfailoutput() { if [ -n "$MSGTEST_MSG" ]; then echo + if [ -n "$MSGTEST_MSGMSG" ]; then + echo "$MSGTEST_MSGMSG" + fi if [ -n "$MSGTEST_GRP" ] && [ "$MSGTEST_GRP" != 'NEXT' ] && [ "$MSGTEST_GRP" != "$MSGTEST_MSG" ]; then echo "${CFAIL}Part of the test group: $MSGTEST_GRP" fi -- 2.45.2