JAL-3130 single class testing on CLI with ant [ -Dclass.name=path/from/classpath...
[jalview.git] / build-j11.xml
index d589cc3..6ed0b0f 100755 (executable)
     </testng>
   </target>
 
+  <target name="testngclass" depends="buildTests">
+    <condition property="propsSpecified">
+      <isset property="class.name" />
+    </condition>
+    <fail unless="propsSpecified" message="class.name property not specified."/>
+    <echo message="testng-groups is '${testng-groups}'" />
+    <testng outputDir="${reportDir}" haltOnFailure="false" groups="${testng-groups}" mode="testng" verbose="2">
+      <classpath>
+        <pathelement location="${testOutputDir}" />
+        <pathelement location="${clover.jar}" if:set="clover.jar"/>
+        <path refid="test.classpath" />
+      </classpath>
+      <jvmarg value="--module-path=${j11libDir}:${java.home}/jmods" if:set="java11"/>
+      <jvmarg value="--add-modules=java.se.ee" if:set="java9"/>
+      <jvmarg value="--illegal-access=warn" if:set="java9"/>
+      <classfileset dir="${testOutputDir}" includes="${class.name}" />
+    </testng>
+  </target>
+
   <target name="buildindices" depends="init, prepare" unless="help.uptodate">
     <replace value="${JALVIEW_VERSION}">
       <replacetoken><![CDATA[$$Version-Rel$$]]></replacetoken>