From 5d8a59e337712be6b32b77e61fcc269093a80c66 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 6 Jul 2022 16:05:42 -0400 Subject: [PATCH 1/2] testsuite: Handle `balanced ASCII quotes' correctly in m4 errors. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AT_CHECK_M4 was _documented_ to convert m4: cannot open `foo': No such file or directory to m4: cannot open 'foo': No such file or directory but the regexp that was supposed to do this didn’t work. Fix the regexp, and remove a workaround for the bug in one test (yes, we had code in our own testsuite to work around bugs in our own testsuite!) * tests/local.at (AT_CHECK_M4): Fix regex for “cannot open” messages. * tests/tools.at (autom4te cache): Remove workaround for buggy regex in AT_CHECK_M4. --- tests/local.at | 12 ++++++------ tests/tools.at | 12 +----------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/tests/local.at b/tests/local.at index 4c2c9903..3f348929 100644 --- a/tests/local.at +++ b/tests/local.at @@ -158,14 +158,14 @@ m4_define([AT_CHECK_M4], m4_case([$4], [], [], [ignore], [], [AT_CHECK([[mv stderr stderr-raw && sed 's/^[^:]*m4[-.ex0-9]*: *\([^:]*:\) *\([0-9][0-9]*: \)/m4:\1\2/ - s/^\([^:]*:\) *\([0-9][0-9]*:\)[^:]*m4[-.ex0-9]*: /m4:\1\2 / - s/: C\(annot open \)\([^`'\'':]*\):/: c\1'\''\2'\'':/ - s/: include:\( cannot open\)/:\1/ - s/^autom4te: [^ ]*m4[.ex]* /autom4te: m4 / - s/^autom4te: error: [^ ]*m4[.ex]* /autom4te: error: m4 / + s/^\([^:]*:\) *\([0-9][0-9]*:\)[^:]*m4[-.ex0-9]*: /m4:\1\2 / + s/: include: [cC]\(annot open\)/: c\1/ + s/: [cC]\(annot open \)[`'\'']*\([^'\'':]*\)'\''*:/: c\1'\''\2'\'':/ + s/^autom4te: [^ ]*m4[.ex]* /autom4te: m4 / + s/^autom4te: error: [^ ]*m4[.ex]* /autom4te: error: m4 / s!^.*/\([^/][^/]*\)\.m4: *[0-9][0-9]*: *!\1.m4: ! s!^.*/\([^/][^/]*\)\.m4: *[0-9][0-9]*: *[0-9][0-9]*: *!\1.m4: ! - s/ (E[A-Z]*)$// + s/ (E[A-Z]*)$// ' stderr-raw >&2]], [0], [], [$4])]) ]) diff --git a/tests/tools.at b/tests/tools.at index ce7efc33..bd225e04 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -98,20 +98,10 @@ AT_CHECK_M4SUGAR # We moved a file: it should fail mkdir sub mv foo sub -case `$M4 no/such/file 2>&1` in - *\`no/such/file*) - AT_CHECK_M4SUGAR([], [1], [], -[m4:script.4s:1: cannot open `foo': No such file or directory -autom4te: error: m4 failed with exit status: 1 -]) - ;; - *) - AT_CHECK_M4SUGAR([], [1], [], +AT_CHECK_M4SUGAR([], [1], [], [m4:script.4s:1: cannot open 'foo': No such file or directory autom4te: error: m4 failed with exit status: 1 ]) - ;; -esac # But if we change the main file, then we should no longer complain of # missing files. -- 2.36.1