From 1b959f0129460f2267e66bc77ca9464c28c915c5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 4 Mar 2025 21:41:41 +0100 Subject: test: Grep continuation lines in error messages This is important for upcoming multi-line solver error message work. --- test/integration/framework | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'test/integration/framework') 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 } -- cgit v1.2.3-70-g09d2