[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: explicitly state that our lexers do not require unistd.h
From: |
Peter Rosin |
Subject: |
[PATCH] tests: explicitly state that our lexers do not require unistd.h |
Date: |
Mon, 5 Mar 2012 15:10:29 +0100 |
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.
* tests/lex-lib.test (foo.l): Likewise.
* tests/lex-libobj.test (foo.l): Likewise.
* tests/lex-line.test (zardoz.l): Likewise.
* tests/lex-nodist.test (lexer.l): Likewise.
* tests/lex-noyywrap.test (foo.l): Likewise.
* tests/lex-pr204.test (lexer.l): Likewise.
* tests/lex-subobj-nodep.test (subl/sl.l): Likewise.
* tests/lex3.test (foo.l): Likewise.
* tests/lex5.test (foo/foo.l): Likewise.
* tests/lexvpath.test (lexer.l): Likewise.
* tests/silent-lex.test (foo.l): Likewise.
* tests/silent-many-gcc.test (foo5.l): Likewise.
* tests/silent-many-generic.test (foo5.l): Likewise.
* tests/lex-clean-cxx.test (parsefoo.lxx): Likewise. Also specify
the never-interactive option to prevent usage of the non-ANSI
function isatty(3) (from unistd.h).
* tests/lex-depend-cxx.test (joe.ll): Likewise.
---
tests/cond35.test | 3 +++
tests/lex-clean-cxx.test | 4 ++++
tests/lex-clean.test | 3 +++
tests/lex-depend-cxx.test | 4 ++++
tests/lex-depend.test | 3 +++
tests/lex-lib-external.test | 3 +++
tests/lex-lib.test | 3 +++
tests/lex-libobj.test | 3 +++
tests/lex-line.test | 3 +++
tests/lex-nodist.test | 3 +++
tests/lex-noyywrap.test | 3 +++
tests/lex-pr204.test | 3 +++
tests/lex-subobj-nodep.test | 3 +++
tests/lex3.test | 3 +++
tests/lex5.test | 3 +++
tests/lexvpath.test | 9 +++++++++
tests/silent-lex.test | 3 +++
tests/silent-many-gcc.test | 3 +++
tests/silent-many-generic.test | 3 +++
19 files changed, 65 insertions(+), 0 deletions(-)
Hi!
Ok for master?
Cheers,
Peter
diff --git a/tests/cond35.test b/tests/cond35.test
index 97b4c8f..043b3b0 100755
--- a/tests/cond35.test
+++ b/tests/cond35.test
@@ -58,6 +58,9 @@ $FGREP 'tparse.h' Makefile.in # For debugging.
test `$FGREP -c 'tparse.h:' Makefile.in` = 1
cat > tscan.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
%%
diff --git a/tests/lex-clean-cxx.test b/tests/lex-clean-cxx.test
index 4fbbfcc..b29bd40 100755
--- a/tests/lex-clean-cxx.test
+++ b/tests/lex-clean-cxx.test
@@ -55,6 +55,10 @@ LDADD = $(LEXLIB)
END
cat > parsefoo.lxx << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
+%option never-interactive
%%
"GOOD" return EOF;
.
diff --git a/tests/lex-clean.test b/tests/lex-clean.test
index 62ed6bb..6988f92 100755
--- a/tests/lex-clean.test
+++ b/tests/lex-clean.test
@@ -54,6 +54,9 @@ LDADD = $(LEXLIB)
END
cat > lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
diff --git a/tests/lex-depend-cxx.test b/tests/lex-depend-cxx.test
index e1560ee..2686a5e 100755
--- a/tests/lex-depend-cxx.test
+++ b/tests/lex-depend-cxx.test
@@ -48,6 +48,10 @@ test-obj-updated: joe.$(OBJEXT) moe.$(OBJEXT)
END
cat > joe.ll << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
+%option never-interactive
%%
"foo" return EOF;
.
diff --git a/tests/lex-depend.test b/tests/lex-depend.test
index 17f66e9..2982845 100755
--- a/tests/lex-depend.test
+++ b/tests/lex-depend.test
@@ -45,6 +45,9 @@ test-obj-updated: joe.$(OBJEXT)
END
cat > joe.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"foo" return EOF;
.
diff --git a/tests/lex-lib-external.test b/tests/lex-lib-external.test
index 399c652..21802c5 100755
--- a/tests/lex-lib-external.test
+++ b/tests/lex-lib-external.test
@@ -42,6 +42,9 @@ have-lexlib:
END
cat > foo.l <<'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
diff --git a/tests/lex-lib.test b/tests/lex-lib.test
index e1cef76..0320f75 100755
--- a/tests/lex-lib.test
+++ b/tests/lex-lib.test
@@ -47,6 +47,9 @@ int yywrap (void)
END
cat > foo.l <<'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/lex-libobj.test b/tests/lex-libobj.test
index a2b128d..3bc2981 100755
--- a/tests/lex-libobj.test
+++ b/tests/lex-libobj.test
@@ -45,6 +45,9 @@ int yywrap (void)
END
cat > foo.l <<'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/lex-line.test b/tests/lex-line.test
index e5457cc..5888c51 100755
--- a/tests/lex-line.test
+++ b/tests/lex-line.test
@@ -60,6 +60,9 @@ dir/address@hidden@: dir/quux.c
END
cat > zardoz.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/lex-nodist.test b/tests/lex-nodist.test
index c1f3b0c..70cd2f7 100755
--- a/tests/lex-nodist.test
+++ b/tests/lex-nodist.test
@@ -47,6 +47,9 @@ check-local: test-build test-dist
lexer.l:
rm -f $@ address@hidden
:; { : \
+ && echo '%{' \
+ && echo '#define YY_NO_UNISTD_H 1' \
+ && echo '%}' \
&& echo '%%' \
&& echo '"GOOD" return EOF;' \
&& echo '.'; \
diff --git a/tests/lex-noyywrap.test b/tests/lex-noyywrap.test
index 1640953..1c4a13b 100755
--- a/tests/lex-noyywrap.test
+++ b/tests/lex-noyywrap.test
@@ -37,6 +37,9 @@ END
cat > foo.l << 'END'
%option noyywrap
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
diff --git a/tests/lex-pr204.test b/tests/lex-pr204.test
index 1ef6205..07b5644 100755
--- a/tests/lex-pr204.test
+++ b/tests/lex-pr204.test
@@ -51,6 +51,9 @@ distdirtest: distdir
EOF
cat > lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
diff --git a/tests/lex-subobj-nodep.test b/tests/lex-subobj-nodep.test
index 8bfc153..44c9776 100755
--- a/tests/lex-subobj-nodep.test
+++ b/tests/lex-subobj-nodep.test
@@ -38,6 +38,9 @@ END
mkdir sub1 sub2
cat >sub1/s1.l <<\END
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/lex3.test b/tests/lex3.test
index 23e14c9..125152b 100755
--- a/tests/lex3.test
+++ b/tests/lex3.test
@@ -33,6 +33,9 @@ foo_SOURCES = foo.l
END
cat > foo.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"GOOD" return EOF;
.
diff --git a/tests/lex5.test b/tests/lex5.test
index dcccc2e..4b0663d 100755
--- a/tests/lex5.test
+++ b/tests/lex5.test
@@ -37,6 +37,9 @@ END
mkdir foo
cat > foo/foo.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/lexvpath.test b/tests/lexvpath.test
index 4572fe5..c731692 100755
--- a/tests/lexvpath.test
+++ b/tests/lexvpath.test
@@ -44,6 +44,9 @@ END
# Original lexer, with a "foobar" comment
cat > lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
@@ -86,6 +89,9 @@ $sleep
# New lexer, with 'fubar' comment.
cat > ../lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
@@ -106,6 +112,9 @@ $sleep
# New lexer, with 'maude' comment.
cat > ../lexer.l << 'END'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/silent-lex.test b/tests/silent-lex.test
index ff68eda..1855538 100755
--- a/tests/silent-lex.test
+++ b/tests/silent-lex.test
@@ -54,6 +54,9 @@ LDADD = $(LEXLIB)
EOF
cat > foo.l <<'EOF'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/silent-many-gcc.test b/tests/silent-many-gcc.test
index 8cba837..8b457ca 100755
--- a/tests/silent-many-gcc.test
+++ b/tests/silent-many-gcc.test
@@ -157,6 +157,9 @@ cat > foo3.f <<'EOF'
end
EOF
cat > foo5.l <<'EOF'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test
index a3d3b81..3949009 100755
--- a/tests/silent-many-generic.test
+++ b/tests/silent-many-generic.test
@@ -184,6 +184,9 @@ cat > foo3.f <<'EOF'
end
EOF
cat > foo5.l <<'EOF'
+%{
+#define YY_NO_UNISTD_H 1
+%}
%%
"END" return EOF;
.
--
1.7.9
- [PATCH] tests: explicitly state that our lexers do not require unistd.h,
Peter Rosin <=