diff options
Diffstat (limited to 'tests/include_by_reentrant.direct.l')
-rw-r--r-- | tests/include_by_reentrant.direct.l | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/include_by_reentrant.direct.l b/tests/include_by_reentrant.direct.l index 9d7967e..2be8b38 100644 --- a/tests/include_by_reentrant.direct.l +++ b/tests/include_by_reentrant.direct.l @@ -29,6 +29,8 @@ #include <stdio.h> #include <stdlib.h> #include "config.h" + +int error = 0; %} %option 8bit prefix="test" @@ -54,6 +56,7 @@ if((fp=fopen(yytext,"r"))==NULL) { fprintf(stderr,"*** Error: Could not open include file \"%s\".\n", yytext); + error = 1; yyterminate(); } yylex_init(&scanner); @@ -66,6 +69,7 @@ } .|\n { fprintf(stderr,"Invalid input \"%s\".\n", yytext); + error = 1; yyterminate(); } } @@ -94,6 +98,9 @@ main ( int argc, char **argv ) yyset_out( stdout, scanner); yylex(scanner); yylex_destroy(scanner); - printf("TEST RETURNING OK.\n"); + if (!error) + printf("TEST RETURNING OK.\n"); + else + exit(-1); return 0; } |