summaryrefslogtreecommitdiff
path: root/tests/include_by_push.direct.l
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2018-02-08 11:16:54 -0800
committerManoj Srivastava <srivasta@debian.org>2018-02-08 11:16:54 -0800
commit5372d368306be0259401d04dcca0172c33cf43b0 (patch)
tree5f5545eebcc6924eba866c76e6241df16764cdb4 /tests/include_by_push.direct.l
parent487177cbb85bc4e88e468c71b27569054b8df090 (diff)
parentab49343b08c933e32de8de78132649f9560a3727 (diff)
Merge tag 'v2.6.4' into upstream
version 2.6.4 Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'tests/include_by_push.direct.l')
-rw-r--r--tests/include_by_push.direct.l13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/include_by_push.direct.l b/tests/include_by_push.direct.l
index 6b7a5fa..8aaea69 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,20 +52,22 @@
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 ));
+ testpush_buffer_state( yy_create_buffer( yyin, YY_BUF_SIZE ));
BEGIN(0);
}
.|\n {
fprintf(stderr,"Invalid input \"%s\".\n", yytext);
+ error = 1;
yyterminate();
}
}
<<EOF>> {
fclose(yyin);
- yypop_buffer_state();
+ testpop_buffer_state();
if(!YY_CURRENT_BUFFER)
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;
}