[antlr-interest] unit tests

Ric Klaren ric.klaren at gmail.com
Thu Nov 23 13:44:22 PST 2006


Hi,

On 11/23/06, Robert Hill <rob.hill at blueyonder.co.uk> wrote:
> Hi all, just want to open up a bit of a discussion, how does everyone else
> handle unit testing for a compiler/code generator.

You could have a look at the ANTLR3 unit tests for inspiration.

> Or if you're using JUnit/NUnit how do test your Antlr output ?

If you have a choice you might have a look at TestNG (testng.org). My
impression is that it's more flexible than Junit (wrt to fixtures,
attaching meta information, grouping of tests , running groups of
tests, parameterization of tests, test factories, and more..). Most
testing I do at the moment does not involve testing of grammars
though, and borders more on integration-ish tests. There's also an
eclipse plugin for testNg which works pretty much the same as the
Junit one, and offers the option of retesting only the failed
testcases.

Cheers,

Ric


More information about the antlr-interest mailing list