[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: explicitly state that our lexers do not require unist
From: |
Peter Rosin |
Subject: |
Re: [PATCH] tests: explicitly state that our lexers do not require unistd.h |
Date: |
Tue, 06 Mar 2012 08:45:29 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
Peter Rosin skrev 2012-03-06 08:38:
> Stefano Lattarini skrev 2012-03-05 21:05:
>> Hi Peter.
>>
>> On 03/05/2012 03:10 PM, Peter Rosin wrote:
>>> By default, GNU flex generates code that is dependent on unistd.h,
>>> which is not portable to non-ANSI systems causing spurious test
>>> failures.
>>>
>>> * tests/cond35.test (tscan.l): Define YY_NO_UNISTD_H.
>>> * tests/lex-clean.test (lexer.l): Likewise.
>>> * tests/lex-depend-cxx.test (joe.ll): Likewise.
>>> * tests/lex-depend.test (joe.l): Likewise.
>>> * tests/lex-lib-external.test (foo.l): Likewise.
>>> ...
>>> 19 files changed, 65 insertions(+), 0 deletions(-)
>>>
>>> Hi!
>>>
>>> Ok for master?
>>>
>> Yes... but I'd like to see a little addition squashed-in if you can: a
>> new entry in 'tests/README' explaining that a "#define YY_NO_UNISTD_H"
>> is needed in lex input files, and why it is so.
>
> Like this?
No, that wasn't quite right, but perhaps like this?
Cheers,
Peter
diff --git a/tests/README b/tests/README
index 42afa2c..5f7be89 100644
--- a/tests/README
+++ b/tests/README
@@ -263,6 +263,18 @@ Do
directory, but use '$am_scriptdir' instead. The complete list of
such "$am_...dir" variables can be found in tests/defs-static.in.
+ When writing input for lex, include the following in the definitions
+ section
+ %{
+ #define YY_NO_UNISTD_H 1
+ %}
+ to accomodate non-ANSI systems, since GNU flex generates code that
+ includes unistd.h otherwise. Also add
+ %option never-interactive
+ to the definitions section if the generated code is to be compiled
+ by a C++ compiler, since the isatty(3) function from that same
+ unistd.h header is required otherwise.
+
Before commit: make sure the test is executable, add the tests to
TESTS in Makefile.am, add it to XFAIL_TESTS in addition if needed,
write a ChangeLog entry, send the diff to <address@hidden>.