]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
tests: store msgmsg message for display in fail as well
[apt.git] / test / integration / framework
index 18bfec7edf0496eb6c7e48312fd1d5cc7296b1b7..6cba26c8dcd10685920e6bfb4d481114661b0d22 100644 (file)
@@ -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