[antlr-interest] unit tests
Robert Hill
rob.hill at blueyonder.co.uk
Thu Nov 23 14:33:44 PST 2006
Thanks Matthias / Rick
I was scratching my head a little, wondering how you'd actually test your
output. I ended up with the output file method purely because I can't really
see any other non-intrusive way to test the output. If the tests were
intrusive then I guess removing the tests would by definition require
retesting..lol! My only worry is minor formatting changes would make tests
fail when it doesn't really affect the files correctness. I suppose I could
strip out all the whitespace, hmm I'll have another think about this!
Thanks for the pointers that I'm on the right track :)
I'll check out the antlr tests, and the sun methods too.
Cheers guys!
/2ob
> -----Original Message-----
> From: Matthias Gutheil [mailto:matthias.gutheil at informatik.uni-
> mannheim.de]
> Sent: 23 November 2006 22:06
> To: Robert Hill
> Subject: Re: [antlr-interest] unit tests
>
> Hi Robert,
>
> we do it in this way with JUnit and a lot of files.
> Sun provides for Java a LOT of test files and also the results to test
> an implementation of the compiler.
>
> Cheers
> Matthias
>
>
> Robert Hill schrieb:
> > Hi all, just want to open up a bit of a discussion, how does everyone
> else
> > handle unit testing for a compiler/code generator.
> > Or if you're using JUnit/NUnit how do test your Antlr output ?
> >
> > File compares on the output sources? How do you test individual
> constructs?
> > Hundred of files( or embedded strings) with each one having a single
> example
> > to the construct in question?
> >
> > Just looking for some good ideas ( or examples :) ) on implementation
> (I'll
> > be using JUinit btw)
> >
> > Cheers all!
> >
> > /2ob
> >
> >
> >
> >
More information about the antlr-interest
mailing list