[antlr-interest] gUnit tests with multiple languages

Kieran Simpson kierans777 at gmail.com
Sat Feb 11 13:33:57 PST 2012


The solution I've come up with is to unit test the parser (the grammar 
that produces an AST) with gUnit and use a testing framework for my 
target language to test the tree walker as the point of the tree walker 
is to interact with my other code.  Using stubs I can examine the 
behaviour of the tree walker as it walks a test AST.

HTH.

On 23/07/64 5:59 AM, Kunal Sawlani wrote:
> Hi,
>
> I am currently using gUnit to test the Java parsers we are currently
> generating from ANTLR.
>
> However, we are using the same grammar source to generate parsers in a
> couple of other languages (Ruby, JavaScript). I would like to use the same
> gUnit tests for testing the results from these parsers as well, to enable
> single sourcing of my tests, and not re-write them for every language.
>
> Is there any way to do this? May be a JSON format for specifying test cases
> which would work for all the languages?
>
> Thanks,
>


More information about the antlr-interest mailing list