Questions tagged [gunit]

In C++ world GUnit is testing framework based on GoogleTest/GoogleMock.

GUnit is an unit testing framework.

It is based on Google Test and Google Mock libraries and simplifies the usage of these libraries.

11 questions
3
votes
2 answers

How to generate JUnit sources using maven-gunit-plugin

I have maven configured to run gunit (an ANTLR grammar unit testing tool) through the maven-gunit-plugin. gunit, however, has two different modes. The first mode causes gunit to act as an interpreter, reading through the *.gunit (or *.testsuite)…
Kaleb Pederson
  • 45,767
  • 19
  • 102
  • 147
2
votes
1 answer

What is the options for antlr.gunit.Interp? How to turn on its verbose option?

I certainly make wrong, but antlr's gunit seems to have no option for the users. bash-3.2$ java org.antlr.gunit.Interp --help Exception in thread "main" java.io.FileNotFoundException: --help (No such file or directory) at…
zell
  • 9,830
  • 10
  • 62
  • 115
2
votes
1 answer

How to use GUNIT with MAVEN?

Given a Maven project generated by : mvn archetype:generate -B -DarchetypeGroupId=org.antlr \ -DarchetypeArtifactId=antlr3-maven-archetype \ -DarchetypeVersion=3.2 \ -DgroupId=com.yourcompany \ -DartifactId=yourproject \ …
jwinandy
  • 1,739
  • 12
  • 22
2
votes
3 answers

Mock a method inside a service class which is under unit test

I have a service class which has 2 methods(one is public and other is protected). I am trying to unit test my code. Below is the code snippet MyServiceClass.groovy class MyServiceClass { public boolean myMethod1() { // some code …
An Ish A
  • 711
  • 5
  • 18
1
vote
1 answer

Passing parameter to parser rule in GUnit

I have a parser rule in ANTLR that takes a parameter. tincture [Tinctures tinctures] returns [Tincture tincture] : { String tinctureName = ""; } ( COLOUR { tinctureName = $COLOUR.text; } | METAL { tinctureName = $METAL.text; } …
luketorjussen
  • 3,156
  • 1
  • 21
  • 38
1
vote
1 answer

Writing unit tests which may access private/protectedstate

I use Boost Test for unit tests. I typically have a fixture struct: class ClassBeingTested { protected: int _x; // Want to access this directly in my unit tests }; struct TestFixture : public ClassBeingTested { // I can access…
user997112
  • 29,025
  • 43
  • 182
  • 361
1
vote
1 answer

Simple Antlr3 Token parsing

while i'm somewhat comforted by the amount of questions regarding Antlr grammar (it's not just me trying to shave this yak shaped thing), i haven't found a question/answer that comes close to helping with my issue. I'm using Antlr3.3 with a mixed…
0
votes
1 answer

Clean up after exception Google c++ test framework

I am using C++ unit tests using the google unit test framework (fixtures), clean up after the tests is very important for me. But in case of an exception the executable crashes and the clean up never happens. Is there a way to force the clean up…
user1918858
  • 1,202
  • 1
  • 20
  • 29
0
votes
2 answers

Decision can match input such as "{'A'..'Z', '_', 'a'..'z'}" using multiple alternatives: 1, 3

I am a startbie for this antlr 3.5. I understood that left recursion is accepted in ant;r 4.0 and not in 3.5, I am getting ambigious error warning for my grammar . I am just verifying my email using this grammar, can some one fix this grammar …
user4065493
0
votes
1 answer

G unit tests giving NullPointerException

I am using G Unit for the first time for testing Antlr3 grammar but while running the tests, I am getting NullPointerException. Exception occurs only when there is a method call in the action part of the grammar rule. Example: identifier : name=ID…
asthac
  • 31
  • 8
0
votes
2 answers

How do I use the Antlr generated junit file made by translating a gunit file

I am trying to make unit tests for multiple return values in Antlr. I have regular unit tests working using gunit. However, I am not too sure what to do with the junit Testgrammar.java file that is generated as per the instructions at…
Mark
  • 3,177
  • 4
  • 26
  • 37