summaryrefslogtreecommitdiff
path: root/tests/include_by_push.direct.l
diff options
context:
space:
mode:
Diffstat (limited to 'tests/include_by_push.direct.l')
-rw-r--r--tests/include_by_push.direct.l9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/include_by_push.direct.l b/tests/include_by_push.direct.l
index 6b7a5fa..345e02f 100644
--- a/tests/include_by_push.direct.l
+++ b/tests/include_by_push.direct.l
@@ -29,6 +29,8 @@
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
+
+int error = 0;
%}
%option 8bit prefix="test"
@@ -50,6 +52,7 @@
yytext[yyleng-1]='\0';
if((yyin=fopen(yytext,"r"))==NULL) {
fprintf(stderr,"*** Error: Could not open include file \"%s\".\n",yytext);
+ error = 1;
yyterminate();
}
yypush_buffer_state( yy_create_buffer( yyin, YY_BUF_SIZE ));
@@ -57,6 +60,7 @@
}
.|\n {
fprintf(stderr,"Invalid input \"%s\".\n", yytext);
+ error = 1;
yyterminate();
}
}
@@ -87,6 +91,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;
}