From: Martin Q. <mqu...@us...> - 2006-08-29 21:46:11
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv25918 Modified Files: Makefile Added Files: multi-parser-run.act multi-parser-run.dtd multi-parser-run.in multi-parser-run.stdout.expected Log Message: A new test trying to run the same parser three times on 'different' inputs. If currently fails since recent changes induced some problems I fail to understand wrt default attribute values --- NEW FILE: multi-parser-run.dtd --- <!ELEMENT foo (bar)*> <!ATTLIST foo name CDATA #REQUIRED> <!ATTLIST foo toz CDATA "0.0"> <!ATTLIST foo gaz CDATA "0.0"> <!ELEMENT bar EMPTY> <!ATTLIST bar name CDATA #REQUIRED> --- NEW FILE: multi-parser-run.in --- <!DOCTYPE foo SYSTEM "multi-parser-run.dtd"> <foo name="toto"><bar name="tutu"/> </foo> Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile 29 Aug 2006 14:14:40 -0000 1.7 +++ Makefile 29 Aug 2006 21:46:05 -0000 1.8 @@ -39,7 +39,7 @@ # test definitions -- add new tests here ##################################################### -EXES = mixed1 mixed-enumatt mixed-stratt mixed-stratt-def +EXES = mixed1 mixed-enumatt mixed-stratt mixed-stratt-def multi-parser-run INTERMEDIATES = $(EXES) $(EXES:%=%.c) $(EXES:%=%.l) UNIT_TESTS = \ @@ -47,8 +47,8 @@ test_mixed-enumatt \ test_mixed-enumatt2 \ test_mixed-stratt \ - test_mixed-stratt-def - + test_mixed-stratt-def \ + test_multi-parser-run test : $(UNIT_TESTS) @@ -72,6 +72,10 @@ test_mixed-stratt-def_cmd = ./mixed-stratt-def < mixed-stratt-def.in test_mixed-stratt-def_deps = mixed-stratt-def mixed-stratt-def.in +# Test multi-parser-run (Run the parser several times on "different" files) +test_multi-parser-run_cmd = ./multi-parser-run multi-parser-run.in +test_multi-parser-run_deps = multi-parser-run multi-parser-run.in + % : %.dtd %.act $(FLEXML) -b 1000 -A -a$@.act $@.dtd $(FLEX) -s -L -o$@.c $@.l --- NEW FILE: multi-parser-run.stdout.expected --- Run 0 foo attributes name='toto' toz='0.0' gaz='0.0' bar attributes name='tutu' Run 1 foo attributes name='toto' toz='0.0' gaz='0.0' bar attributes name='tutu' Run 2 foo attributes name='toto' toz='0.0' gaz='0.0' bar attributes name='tutu' --- NEW FILE: multi-parser-run.act --- <!DOCTYPE actions SYSTEM "flexml-act.dtd"> <actions> <top><![CDATA[ #include <stdio.h> ]]></top> <start tag='foo'><![CDATA[ printf("foo attributes name='%s' toz='%s' gaz='%s'\n", {name}, {toz}, {gaz}); ]]></start> <start tag='bar'><![CDATA[ printf("bar attributes name='%s'\n", {name}); ]]></start> <main><![CDATA[ int main(int argc, char **argv) { FILE *infile; YY_BUFFER_STATE buff; int retval; int i; for (i=0; i<3; i++) { printf("Run %d\n",i); infile=fopen(argv[1],"r"); buff=yy_create_buffer(infile,10); yy_switch_to_buffer(buff); retval = yylex(); yy_delete_buffer(buff); fclose(infile); } return retval; } ]]></main> </actions> |