[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2.62 AT_SETUP limitations

From: Joel E. Denny
Subject: 2.62 AT_SETUP limitations
Date: Tue, 22 Apr 2008 04:36:02 -0400 (EDT)


According to Autoconf 2.62's manual, AT_SETUP no longer allows unbalanced 
parentheses to appear in test case titles.  This regression breaks CVS 
Bison's test suite, which worked fine with 2.61, and it seems like an 
unnecessary limitation.

Bison's test suite contains a series of test cases for file names 
containing special characters.  The test case titles show which special 
characters are being tested.  For example:

  Output file name: address@hidden&*()-=_+{}[]|\:
  Output file name: (
  Output file name: )
  Output file name: #
  Output file name: @@
  Output file name: @{
  Output file name: @}
  Output file name: [
  Output file name: ]

The second test case title above now causes "make testsuite" to produce 
this error:

  /usr/bin/m4:output.at:189: ERROR: end of file in string
  autom4te: /usr/bin/m4 failed with exit status: 1
  make: *** [testsuite] Error 1

(In case you decide to check out Bison, I've temporarily commented out the 
second and third test cases above to work around this.  They can easily be 
uncommented at the end of tests/output.at.)  I also have a test suite for 
another project that involves regular expressions, and so it has even more 
complex test case titles that now have the same problem.

Instead of adding the precondition "no unbalanced parentheses" to 
AT_SETUP, why not add the precondition "the argument must expand properly 
quoted"?  In general, I seem to able to write m4 macros that can reliably 
manipulate any user arguments that meet the latter precondition.  Given 
autom4te's quadrigraphs for brackets, the user is then never limited on 
what strings he can specify to my macros.  I think this should be possible 
with AT_SETUP as well.

For example:

  AT_SETUP([[Output file name: (]])

Or if the user needs to pass in a macro for expansion:

  m4_define([test_char], [[(]])
  AT_SETUP([[Output file name: ]test_char])

AT_SETUP can use m4_dquote($1) to initially expand the argument.  If $1 
meets the precondition, this will expand to a perfectly quoted string that 
can be passed to, for example, m4_bpatsubst for shell-escaping.  The 
result of m4_bpatsubst can be placed in the output shell script.

Is this precondition believed to be insufficient?  Or is the trouble that 
it breaks backward compatibility?  In the latter case, can we add an 
AT_SETUP_ROBUST that can handle unbalanced parentheses?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]