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.
- Create a class which extends Generic Test (e.g. EXAMPLECLASS)
- implement the getFileName() method with the file name (not full path) of the file you want to run (e.g. example.txt).
- Create your text file in src/VEW/XMLCompiler/ANTLR/test/test files
- 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 {}