]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
testsuite: Handle `balanced ASCII quotes' correctly in m4 errors.
authorZack Weinberg <zackw@panix.com>
Wed, 6 Jul 2022 20:05:42 +0000 (16:05 -0400)
committerZack Weinberg <zackw@panix.com>
Wed, 6 Jul 2022 20:05:42 +0000 (16:05 -0400)
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
tests/tools.at

index 4c2c99036dd55331930b6c7baf3e1ede38f09742..3f348929f392f0ab6210eef28464568d7d1f86d3 100644 (file)
@@ -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])])
 ])
 
index ce7efc335e1e0f5a37a91fc45792fb2f23ce9e82..bd225e042147a2ab6be2a825abf9adc08ec168c1 100644 (file)
@@ -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.