aboutsummaryrefslogtreecommitdiff
path: root/test cases/frameworks
diff options
context:
space:
mode:
authorAdrien Plazas <kekun.plazas@laposte.net>2021-08-11 09:57:56 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-08-11 21:47:53 +0300
commit042adba204adeb8599e6ce516e0615f9a7b1f9c0 (patch)
tree8e82ab42b4479a2b7f71b4e19072ae833f1c5156 /test cases/frameworks
parent6a83f8b9cbac9eaa31307064b589d3ef41c0a293 (diff)
downloadmeson-042adba204adeb8599e6ce516e0615f9a7b1f9c0.zip
meson-042adba204adeb8599e6ce516e0615f9a7b1f9c0.tar.gz
meson-042adba204adeb8599e6ce516e0615f9a7b1f9c0.tar.bz2
Make the flex test case work
This adds the noyywrap option so flex doesn't wait for more input once we reached EOF. This also adds the nounput and noinput options to fix compilation warnings. We can now run the test as expected.
Diffstat (limited to 'test cases/frameworks')
-rw-r--r--test cases/frameworks/8 flex/lexer.l4
-rw-r--r--test cases/frameworks/8 flex/prog.c10
2 files changed, 3 insertions, 11 deletions
diff --git a/test cases/frameworks/8 flex/lexer.l b/test cases/frameworks/8 flex/lexer.l
index 952eeea..8ea7df8 100644
--- a/test cases/frameworks/8 flex/lexer.l
+++ b/test cases/frameworks/8 flex/lexer.l
@@ -6,6 +6,8 @@ extern int yylex(void);
extern int yyerror();
%}
-%%
+%option noyywrap nounput noinput
+
+%%
("true"|"false") {return BOOLEAN;}
. { yyerror(); }
diff --git a/test cases/frameworks/8 flex/prog.c b/test cases/frameworks/8 flex/prog.c
index 0b84d18..d94d7b1 100644
--- a/test cases/frameworks/8 flex/prog.c
+++ b/test cases/frameworks/8 flex/prog.c
@@ -9,7 +9,6 @@
extern int yyparse();
int main(int argc, char **argv) {
- /*
int input;
if(argc != 2) {
printf("%s <input file>");
@@ -19,15 +18,6 @@ int main(int argc, char **argv) {
dup2(input, STDIN_FILENO);
close(input);
return yyparse();
- */
- /* We really should test that the
- * generated parser works with input
- * but it froze and I don't want to waste
- * time debugging that. For this test what
- * we care about is that it compiles and links.
- */
- void* __attribute__((unused)) dummy = (void*)yyparse;
- return 0;
}
int yywrap(void) {