Re: Checks in m4 and different format of error messages

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.bugs
Organization Red Hat, Inc.
Message-ID <[email protected]>
[moving to the public mailing list with permission]

On 2/18/20 9:01 AM, Mikhail Sviridov wrote:
> Hi Gary, Eric
> 
> I'm not sure if there is any possibility to specify a pattern instead of
> fixed text in the following line of checks/137.include and many other files
> there:
> dnl @error{}m4:stdin:1: cannot open `none': No such file or directory
> 
> because in our system we have a different format of the message:
> 
> cannot open `none': EDC5129I No such file or directory. (errno2=0x05620062)
> 
> The first solution that comes to mind is to change the error message under
> @error macro, but is there any crossplatform way to do that or specify a
> pattern instead of fixed text?

You didn't mention what system this is on.

If you'll look at the script checks/check-them, you will see that the 
testsuite already does some post-processing filtering on the actual m4 
output to move it into a form that it can be compared against the 
expected output embedded in the tests themselves (for example, look at 
the setting and use of the $m4name variable).  It sounds like your 
system's strerror() output (with the extra "EDC5129I" and 
"(errno2=0x05620062)" information) would be the perfect candidate for 
adding yet another filter to that script.

Patches are welcome.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.