private static String test(RuntimeTestDescriptor descriptor, RuntimeRunner runner) {
		String targetName = runner.getLanguage();
		if (descriptor.ignore(targetName)) {
			System.out.println("Ignore " + descriptor);
			return null;
		}

		FileUtils.mkdir(runner.getTempDirPath());

		String grammarName = descriptor.grammarName;
		String grammar = prepareGrammars(descriptor, runner);

		String lexerName, parserName;
		boolean useListenerOrVisitor;
		String superClass;
		if (descriptor.testType == GrammarType.Parser || descriptor.testType == GrammarType.CompositeParser) {
			lexerName = grammarName + "Lexer";
			parserName = grammarName + "Parser";
			useListenerOrVisitor = true;
			if (targetName.equals("Java")) {
				superClass = JavaRunner.runtimeTestParserName;
			}
			else {
				superClass = null;
			}
		}
		else {
			lexerName = grammarName;
			parserName = null;
			useListenerOrVisitor = false;
			if (targetName.equals("Java")) {
				superClass = JavaRunner.runtimeTestLexerName;
			}
			else {
				superClass = null;
			}
		}

		RunOptions runOptions = new RunOptions(grammarName + ".g4",
				grammar,
				parserName,
				lexerName,
				useListenerOrVisitor,
				useListenerOrVisitor,
				descriptor.startRule,
				descriptor.input,
				false,
				descriptor.showDiagnosticErrors,
				descriptor.traceATN,
				descriptor.showDFA,
				Stage.Execute,
				targetName,
				superClass,
				descriptor.predictionMode,
				descriptor.buildParseTree
		);

		State result = runner.run(runOptions);

		return assertCorrectOutput(descriptor, targetName, result);
	}
This class represents runtime tests for specified runtime.
 It pulls data from {@link RuntimeTestDescriptor} and uses junit to trigger tests.
 The only functionality needed to execute a test is defined in {@link RuntimeRunner}.
 All the various test rig classes derived from this one.
 E.g., see {@link JavaRuntimeTests}.
runtime-testsuite/test/org/antlr/v4/test/runtime/RuntimeTests.java