Skip to content

Commit 6fc41fb

Browse files
Add AntRun target to run html5lib-tests suite
This change adds an AntRun target which executes during the Maven “test” phase and calls TreeTester and TokenizerTester to run all test cases in the html5lib-tests suite.
1 parent d0dd5ab commit 6fc41fb

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

pom.xml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,45 @@
104104
</target>
105105
</configuration>
106106
</execution>
107+
<execution>
108+
<id>test</id>
109+
<phase>test</phase>
110+
<goals>
111+
<goal>run</goal>
112+
</goals>
113+
<configuration>
114+
<target>
115+
<property name="test_classpath" refid="maven.test.classpath"/>
116+
<property name="failonerror" value="true"/>
117+
<!-- We use fork="true" here because without it, when we run -->
118+
<!-- Maven in GitHub Actions, we get an “Unable to find a -->
119+
<!-- javac compiler” error — because Ant looks for javac in -->
120+
<!-- the jre/ subdirectory of the JDK directory. -->
121+
<javac srcdir="${project.build.testSourceDirectory}" destdir="${project.build.testOutputDirectory}" fork="true" includeantruntime="false">
122+
<classpath>
123+
<pathelement location="${project.build.outputDirectory}"/>
124+
</classpath>
125+
</javac>
126+
<!-- We use fork="true" here because without it, we otherwise get -->
127+
<!-- java.lang.NoClassDefFoundError: jdk/internal/reflect/ConstructorAccessorImpl -->
128+
<java classname="nu.validator.htmlparser.test.TokenizerTester" fork="true" failonerror="${failonerror}">
129+
<classpath>
130+
<pathelement path="${test_classpath}"/>
131+
<pathelement location="${project.build.outputDirectory}"/>
132+
<pathelement location="${project.build.testOutputDirectory}"/>
133+
</classpath>
134+
<arg value="${basedir}/html5lib-tests/tokenizer"/>
135+
</java>
136+
<java classname="nu.validator.htmlparser.test.TreeTester" fork="true" failonerror="${failonerror}">
137+
<classpath>
138+
<pathelement location="${project.build.outputDirectory}"/>
139+
<pathelement location="${project.build.testOutputDirectory}"/>
140+
</classpath>
141+
<arg value="${basedir}/html5lib-tests/tree-construction"/>
142+
</java>
143+
</target>
144+
</configuration>
145+
</execution>
107146
<execution>
108147
<id>tokenizer-hotspot-workaround</id>
109148
<phase>process-sources</phase>
@@ -115,7 +154,11 @@
115154
<property name="translator.sources" value="${basedir}/translator-src"/>
116155
<property name="translator.classes" value="${project.build.directory}/translator-classes"/>
117156
<mkdir dir="${translator.classes}"/>
118-
<javac srcdir="${translator.sources}" includes="nu/validator/htmlparser/generator/ApplyHotSpotWorkaround.java" destdir="${translator.classes}" includeantruntime="false"/>
157+
<!-- We use fork="true" here because without it, when we run -->
158+
<!-- Maven in GitHub Actions, we get an “Unable to find a -->
159+
<!-- javac compiler” error — because Ant looks for javac in -->
160+
<!-- the jre/ subdirectory of the JDK directory. -->
161+
<javac srcdir="${translator.sources}" includes="nu/validator/htmlparser/generator/ApplyHotSpotWorkaround.java" fork="true" destdir="${translator.classes}" includeantruntime="false"/>
119162
<java classname="nu.validator.htmlparser.generator.ApplyHotSpotWorkaround">
120163
<classpath>
121164
<pathelement location="${translator.classes}"/>

0 commit comments

Comments
 (0)