[antlr-interest] ANTLR & Testing: Experiences and Practices?

Pete Forman pete.forman at westerngeco.com
Thu Nov 7 00:47:33 PST 2002


At 2002-11-06 16:44 +0000, micheal_jor wrote:
>If you have found a testing solution that works for you - perhaps
>using xUnit and/or Bogdan Mitu's tester.zip - I'll be grateful for a
>description of the solution and perhaps a sample that demonstrates
>how you make it all work for you.

I run regression tests on the parsers that I've written.  These tests
are done using a commercial package.  In the past I used "make check"
to run them.  The tests are simply feeding input and comparing output.

Here is a bit of a GNUmakefile to illustrate.

check: xml ...

xml: Main.class
         @echo "== starting XML tests"
         fail=0; for f in $(FILES); \
         do $(JAVA) -cp "$(ANTLR_PATH)$(CP_SEP)$(GL_PATH)$(CP_SEP)." \
             Main +filename +lay -xml input/$$f > actual/$$f 2>&1; \
           cmp actual/$$f expected/$$f || fail=1; \
         done; if [ $$fail = 0 ] ; then echo "== XML tests passed"; fi



-- 
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
pete.forman at westerngeco.com    -./\.-   opinion of Schlumberger, Baker
http://petef.port5.com           -./\.-   Hughes or their divisions.


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list