]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: avoid spurious failures with non-flex 'lex' programs and C++
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 8 Apr 2012 22:17:48 +0000 (00:17 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 8 Apr 2012 22:22:22 +0000 (00:22 +0200)
This change fixes automake bug#11185.

The commit v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly
state that our lexers do not require unistd.h" has broken the tests
'lex-clean-cxx.test' and 'lex-depend-cxx.test' on Solaris, where lex
is not flex and does not understand the "%option never-interactive"
directive.  Remove the use of this directive, resorting to defining
a dummy 'isatty()' function instead to keep the flex-generated tests
able to compile also on MinGW/MSYS.

* tests/lex-clean-cxx.test (parsefoo.lxx): Define a dummy 'isatty()'
function.
* tests/lex-depend-cxx.test (joe.ll): Likewise.
* tests/README: Adjust.  Fix an unrelated typo since we are at it.

Co-authored-by: Peter Rosin <peda@lysator.liu.se>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
tests/README
tests/lex-clean-cxx.test
tests/lex-depend-cxx.test

index 33a653c710fab534088a0751e57a93f606035fd5..b7009ca7a64dab0ec7947e3380c3cee64a6bff10 100644 (file)
@@ -268,9 +268,9 @@ Do
     %{
     #define YY_NO_UNISTD_H 1
     %}
-  to accomodate non-ANSI systems, since GNU flex generates code that
+  to accommodate non-ANSI systems, since GNU flex generates code that
   includes unistd.h otherwise.  Also add:
-    %option never-interactive
+    static int isatty (int fd) { return 0; }
   to the definitions section if the generated code is to be compiled
   by a C++ compiler, for similar reasons (i.e., the isatty(3) function
   from that same unistd.h header would be required otherwise).
index 9ff2dbc000908b6f3938a3ee9bed86324c439ecf..4089f0e2b5d12c15c331c3bfc3837ce1938efaef 100755 (executable)
@@ -55,8 +55,8 @@ END
 cat > parsefoo.lxx << 'END'
 %{
 #define YY_NO_UNISTD_H 1
+static int isatty (int fd) { return 0; }
 %}
-%option never-interactive
 %%
 "GOOD"   return EOF;
 .
index 52491022ba730738b0f1685c257cdd92ce2855c8..8e7a2391c43179c46024fa381b83ab48cb8ca873 100755 (executable)
@@ -48,8 +48,8 @@ END
 cat > joe.ll << 'END'
 %{
 #define YY_NO_UNISTD_H 1
+static int isatty (int fd) { return 0; }
 %}
-%option never-interactive
 %%
 "foo" return EOF;
 .