gUnitEditor - A Swing GUI for gUnit

  • gUnit (created by Leon Su) is a unit testing tool for ANTLR v3 grammars.
  • gUnitEditor is a Java Swing GUI for creating, editing and running gUnit test cases.

gUnitEditor uses:

  • ANTLR Tool for parsing grammar files and gUnit test scripts.
  • StringTemplate for generating gUnit scripts.
  • gUnit for running testcases

Get gUnitEditor

Screenshots


Editor View


Script View


Runner View

How to use

Creating a testsuite

  1. Open gUnitEditor and click "Create".
  2. Select the grammar file (*.g) you want to test.
  3. All the rules will be load into the list on the left.
  4. Select a rule and add testcases using the editor on the right.
  5. The testsuite file (*.gunit) is automatically saved in the same directory of the grammar file.

Modifying a testsuite

  1. Open gUnitEditor and click "Open".
  2. Select the testsuite file (*.gunit).
  3. All the tested and un-tested rules will be load into the list.
  4. The tested grammar file must be in the same directory of the testsuite file.

Running a testsuite

The class files of the parser and lexer should be in the same directory of the .g and .gunit file.

  1. Create or open a testsuite
  2. Click "Run"
  3. The test result tree will show up in a tab.

Tips

  1. Since double-quotes is reserved in gUnit, if your test case uses ", please use \" instead.
  2. gUnitEditor is a GUI for gUnit. Currently, gUnit can only test Java targeted grammars.