diff options
Diffstat (limited to 'test/integration/framework')
| -rw-r--r-- | test/integration/framework | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/test/integration/framework b/test/integration/framework index 35c1a1032..d2570b6b2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -2068,6 +2068,19 @@ testfailureequal() { testreturnstateequal 'testfailure' "$@" } +grepmsg() { + awk '{ + if (/^[WEN]:/) + msg=1; + else if (/^ / && msg) + msg=1; + else + msg=0; + if (msg) + print + }' +} + testfailuremsg() { msggroup 'testfailuremsg' local CMP="$1" @@ -2075,7 +2088,7 @@ testfailuremsg() { testfailure "$@" msgtest 'Check that the output of the previous failed command has expected' 'failures and warnings' local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailuremsg.comparefile" - grep '^\(W\|E\|N\):' "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" > "$COMPAREFILE" 2>&1 || true + grepmsg < "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" > "$COMPAREFILE" 2>&1 || true testoutputequal "$COMPAREFILE" echo "$CMP" msggroup } @@ -2086,7 +2099,7 @@ testwarningmsg() { testwarning "$@" msgtest 'Check that the output of the previous warned command has expected' 'warnings' local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarningmsg.comparefile" - grep '^\(W\|E\|N\):' "${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output" > "$COMPAREFILE" 2>&1 || true + grepmsg < "${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output" > "$COMPAREFILE" 2>&1 || true testoutputequal "$COMPAREFILE" echo "$CMP" msggroup } |
