ANTLR Parser Generic tests - adamishaq/Virtual-Ecology-Workbench GitHub Wiki

Given a file of code, the abstract class GenericTest runs the ANTLRparser over the file and will fail the test if the file does not parse.

  1. Create a class which extends Generic Test (e.g. EXAMPLECLASS)
  2. implement the getFileName() method with the file name (not full path) of the file you want to run (e.g. example.txt).
  3. Create your text file in src/VEW/XMLCompiler/ANTLR/test/test files
  4. Edit the AllTests.java file to include your class in the suite:

@RunWith(Suite.class)

@SuiteClasses({ AssignTest.class, SimpleParserLexer.class, EXAMPLECLASS.class})

public class AllTests {}