messing with poms to get test generation in there. it doesn't seem to compiled and properly though. mvn compile works but mvn install doesn't finished compiling generated tests.

This commit is contained in:
parrt 2015-06-26 17:07:10 -07:00
parent f71e225cf2
commit b05e3ccdb8
4 changed files with 18 additions and 34 deletions

View File

@ -187,6 +187,22 @@
</configuration>
</plugin>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-testgen-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
<goal>antlr4.testgen</goal>
</goals>
<configuration>
<runtimeTemplates>${session.executionRootDirectory}/runtime-testsuite/resources/org/antlr/v4/test/runtime/java/Java.test.stg</runtimeTemplates>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -23,17 +23,6 @@
<artifactId>ST4</artifactId>
<version>4.0.8</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@ -44,6 +33,7 @@
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>ignored</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
@ -112,6 +102,5 @@
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
<testSourceDirectory>ignored</testSourceDirectory>
</build>
</project>

View File

@ -64,10 +64,6 @@ public class TestGenerator {
*
* Example:
*
* $ java org.antlr.v4.testgen.TestGenerator -o /tmp -templates /Users/parrt/antlr/code/antlr4/tool/test/org/antlr/v4/test/runtime/java/Java.test.stg
*
* Most commonly:
*
* $ java org.antlr.v4.testgen.TestGenerator -root /Users/parrt/antlr/code/antlr4
*/
public static void main(String[] args) {
@ -280,8 +276,7 @@ public class TestGenerator {
public String getTestTemplatesResourceDir() { return "org/antlr/v4/test/runtime/templates"; }
public String getTargetNameFromTemplatesFileName() {
// runtimeTemplates is like /Users/parrt/antlr/code/antlr4/tool/test/org/antlr/v4/test/runtime/java/Java.test.stg
// extra target name
// runtimeTemplates is like ~/antlr/code/antlr4/runtime-testsuite/resources/org/antlr/v4/test/runtime/java/Java.test.stg
int targetEnd = runtimeTemplates.getName().indexOf(".test.stg");
return runtimeTemplates.getName().substring(0, targetEnd);
}

View File

@ -85,22 +85,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-testgen-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
<goal>antlr4.testgen</goal>
</goals>
<configuration>
<runtimeTemplates>test/org/antlr/v4/test/runtime/java/Java.test.stg</runtimeTemplates>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>