diff options
author | Manoj Srivastava <srivasta@debian.org> | 2018-02-08 13:02:55 -0800 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2018-02-08 13:02:55 -0800 |
commit | 8852aa3f8eefeee4da27de0553b1653253b15619 (patch) | |
tree | 7e6b583ae61340aed4c30303b29d25944273b188 /tests/include_by_buffer.direct.l | |
parent | 355fad18841ec452fc9931ab7f1dbd93d5ebd0ca (diff) | |
parent | 7a39ce3d46f3d049ead08a455c5fcb1b37e153e3 (diff) |
Merge branch 'upstream'
Update to v2.6.4
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'tests/include_by_buffer.direct.l')
-rw-r--r-- | tests/include_by_buffer.direct.l | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/include_by_buffer.direct.l b/tests/include_by_buffer.direct.l index f3b2d2a..79ff01c 100644 --- a/tests/include_by_buffer.direct.l +++ b/tests/include_by_buffer.direct.l @@ -29,6 +29,8 @@ f * are met: #include <stdio.h> #include <stdlib.h> #include "config.h" + +int error = 0; %} %option 8bit prefix="test" @@ -56,6 +58,7 @@ int include_stack_ptr = 0; include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; if((yyin=fopen(yytext,"r"))==NULL) { fprintf(stderr,"*** Error: Could not open include file \"%s\".\n",yytext); + error = 1; yyterminate(); } yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE )); @@ -63,6 +66,7 @@ int include_stack_ptr = 0; } .|\n { fprintf(stderr,"Invalid input \"%s\".\n", yytext); + error = 1; yyterminate(); } } @@ -97,6 +101,9 @@ main ( int argc, char** argv ) yyin = fp; yyout = stdout; yylex(); - printf("TEST RETURNING OK.\n"); + if (!error) + printf("TEST RETURNING OK.\n"); + else + exit(-1); return 0; } |