tools/FxTestRunner/run_javatest_macro.xml

Print this page




  11  * by Oracle in the LICENSE file that accompanied this code.
  12  *
  13  * This code is distributed in the hope that it will be useful, but WITHOUT
  14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  16  * version 2 for more details (a copy is included in the LICENSE file that
  17  * accompanied this code).
  18  *
  19  * You should have received a copy of the GNU General Public License version
  20  * 2 along with this work; if not, write to the Free Software Foundation,
  21  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  22  *
  23  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  24  * or visit www.oracle.com if you need additional information or have any
  25  */
  26 -->
  27 <project name="javatest_utility_macro" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
  28     <dirname property="jclient.root.dir" file="${ant.file.fxprobe}"/>
  29     <import file="nbproject/build-impl.xml"/>
  30 




  31     <macrodef name="run-javatest">
  32         <attribute name="testmode"/>
  33         <sequential>

  34             <echo message="testmode = @{testmode}" />
  35             <echo message="Javatest Basedir = ${fxtest.basedir}" />
  36             <echo message="external.output = ${external.output}" />
  37             
  38             <fail message="fxtest.basedir not set" unless="fxtest.basedir" />
  39             <property name="workdir" value="${fxtest.basedir}/workdir_@{testmode}"/>
  40             <property name="reportdir" value="${fxtest.basedir}/reportdir_@{testmode}"/>
  41             <!-- default values -->
  42             <property name="javatest.runmode" value="desktop"/>
  43             <property name="javatest.pipelineGroup" value="Hardware(Default)"/>
  44             <!-- find utils -->
  45             <property name="javatest.jar" value="${jclient.root.dir}/../../tools/lib/javatest.jar"/>
  46             <property name="HtmlTestRunner.jar" value="${jclient.root.dir}/../../tools/HtmlTestRunner/dist/HtmlTestRunner.jar"/>
  47 
  48             <!-- JTI MAGIC -->
  49             
  50             <!-- step 0: jti file's names -->
  51             <property name="fxsqe.jti.base" value="${jclient.root.dir}/../../tools/FxTestRunner/javatest_base/@{testmode}.jti.base" />
  52             <property name="fxsqe.jti.suite-specific" value="${basedir}/javatest_files/@{testmode}.jti" />
  53             <property name="jti" value="${fxtest.basedir}/@{testmode}.jti"/>
  54 
  55             <!-- step 1: load properties (non-override rule) in next order: -Dfxsqe.name, fxsqe.jti.suite-specific -->
  56             <property file="${fxsqe.jti.base}" prefix="javatest"/>
  57 
  58             <!-- step 2: load filters (override works) in next order: fxsqe.jit.base, fxsqe.jti.suite-specific -->
  59             <filter filtersfile="${fxsqe.jti.base}" />
  60             <filter filtersfile="${fxsqe.jti.suite-specific}" />
  61 
  62             <!-- step 3: apply run-specific values to filters. Unset values are preloaded in step 1. -->
  63             <filter token="runmode" value="${javatest.runmode}"/>
  64             <filter token="pipelineGroup" value="${javatest.pipelineGroup}"/>
  65             <filter token="browserPath" value="${javatest.browserPath}"/>
  66             <filter token="javawsPath" value="${javatest.javawsPath}"/>
  67             <filter token="vmOptions" value="${javatest.vmOptions}"/>
  68             <filter token="dryrun" value="${javatest.dryrun}"/>
  69 





  70             <!-- step 4: set the rest of filters-->
  71 
  72             <condition property="javafx.home" value="${javafx.rt}">
  73             <not>
  74                 <isset property="javafx.home"/>
  75             </not>
  76             </condition>
  77             <pathconvert targetos="unix" property="javafx.home.converted">
  78                 <path location="${javafx.home}"/>
  79             </pathconvert>
  80             <echo message="debug: javafx.home = ${javafx.home}"/>

  81             <echo message="debug: javafx.home.converted = ${javafx.home.converted}"/>

  82 




  83 
  84             <condition property="fvalue.javafx.home" value="${javafx.home.remote}" else="${javafx.home.converted}">

  85                 <isset property="javafx.home.remote"/>
  86             </condition>
  87             <condition property="fvalue.remote" value="Yes" else="No">
  88                 <isset property="javafx.home.remote"/>
  89             </condition>
  90             <condition property="fvalue.javaPath" value="javaPath=java" else="">

  91                 <isset property="javafx.home.remote"/>
  92             </condition>
  93 
  94             <filter token="javafx.home" value="${fvalue.javafx.home}"/>
  95             <filter token="remote" value="${fvalue.remote}"/>
  96             <filter token="javaPath=" value="${fvalue.javaPath}"/>
  97 
  98             <filter token="TESTSUITE" value="${basedir}/${test.sources}"/>

  99             <filter token="WORKDIR" value="${workdir}"/>

 100             <filter token="external.output" value="${fxtest.basedir}"/>












 101 
 102             <!-- step 5: copy template with applied filters -->
 103             <copy overwrite="true" filtering="true" file="${jclient.root.dir}/../../tools/FxTestRunner/javatest_base/@{testmode}.jti.template" tofile="${jti}"/>
 104 
 105             <!-- step 5: add Vera's tricks -->
 106             <antcall target="trickcase1"/>
 107             <antcall target="trickcase2"/>
 108             <!-- END OF JTI MAGIC -->    
 109                 
 110             <!-- classpath -->
 111             <property name="client.test.root" value="${basedir}/${test.sources}"/>
 112             <property name="javatest.classpath" value="${jclient.root.dir}/../../tools/FxTestRunner/dist/FxTestRunner.jar:${javatest.jar}:${HtmlTestRunner.jar}:${build.test.classes.dir}:${javac.test.classpath}:${jclient.root.dir}/../../tools/lib/jetty-all.jar:${jclient.root.dir}/../../tools/SharedTestUtilsOpen/dist/SharedTestUtilsOpen.jar:${jclient.root.dir}/../../tools/lib/servlet-api.jar"/>
 113             <echo message="classpath=${javatest.classpath}"/>
 114 
 115             <!-- agent / utility mode stuff -->
 116             <condition property="javatest.opt" value="-batch" else="">
 117                 <equals arg1="${javatest.mode.batch}" arg2="true" />
 118             </condition>
 119             <condition property="javatest.agent.pool" value="-startAgentPool" else="">
 120                 <isset property="javafx.home.remote"/>
 121             </condition>
 122 
 123             <!-- run javatest -->
 124        
 125             <mkdir dir="${workdir}"/>
 126             <!-- update defaults --> 
 127 
 128             <condition property="javatest.debug.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5858" else="">
 129                 <isset property="javatest.debug"/>
 130             </condition>
 131 
 132             <property name="javatest.java" value="java"/>        
 133 
 134             <java classpath="${javatest.classpath}"
 135                   classname="com.sun.javatest.tool.Main" fork="true" failonerror="false" jvm="${javatest.java}">
 136                 <jvmarg line="${javatest.debug.jvmargs}"/>



 137                 <sysproperty key="client.test.root" value="${client.test.root}"/>
 138                 <sysproperty key="javatest.security.noSecurityManager" value="true"/>
 139                 <sysproperty key="client.exclude.nodesc" value="${exclude.nodesc}"/>
 140                 <sysproperty key="client.exclude.desc" value="${exclude.desc}"/>
 141                 <sysproperty key="javatest.FXProcessCommand.verbose" value="${javatest.FXProcessCommand.verbose}"/>
 142                 <arg line="-config"/>
 143                 <arg line="${jti}"/>
 144                 <arg line="-workdir"/>
 145                 <arg line="${workdir}"/>
 146                 <arg line="-testsuite"/>
 147                 <arg line="${basedir}/${test.sources}"/>
 148                 <arg line="${javatest.opt}"/>
 149                 <arg line="${javatest.agent.pool}"/>
 150             </java>
 151 
 152             <delete includeEmptyDirs="true" failonerror="false">
 153                 <fileset dir="${reportdir}"/>
 154             </delete>
 155             <mkdir dir="${reportdir}"/>
 156             <echo message="Writing TXT report"/>
 157             <java classpath="${javatest.classpath}"
 158                   classname="com.sun.javatest.tool.Main" fork="true" failonerror="false" jvm="${javatest.java}">



 159                 <sysproperty key="client.test.root" value="${client.test.root}"/>
 160                 <sysproperty key="javatest.security.noSecurityManager" value="true"/>
 161                 <sysproperty key="client.exclude.nodesc" value="${exclude.nodesc}"/>
 162                 <sysproperty key="client.exclude.desc" value="${exclude.desc}"/>
 163                 <arg line="-config"/>
 164                 <arg line="${jti}"/>
 165                 <arg line="-workdir"/>
 166                 <arg line="${workdir}"/>
 167                 <arg line="-testsuite"/>
 168                 <arg line="${basedir}/${test.sources}"/>
 169                 <arg line="${javatest.opt}"/>
 170                 <arg line="-writeReport -type txt -filter allTests ${reportdir}"/>
 171             </java>
 172             <echo message="Writing HTML report"/>
 173             <java classpath="${javatest.classpath}"
 174                   classname="com.sun.javatest.tool.Main" fork="true" failonerror="false" jvm="${javatest.java}">



 175                 <sysproperty key="client.test.root" value="${client.test.root}"/>
 176                 <sysproperty key="javatest.security.noSecurityManager" value="true"/>
 177                 <sysproperty key="client.exclude.nodesc" value="${exclude.nodesc}"/>
 178                 <sysproperty key="client.exclude.desc" value="${exclude.desc}"/>
 179                 <arg line="-config"/>
 180                 <arg line="${jti}"/>
 181                 <arg line="-workdir"/>
 182                 <arg line="${workdir}"/>
 183                 <arg line="-testsuite"/>
 184                 <arg line="${basedir}/${test.sources}"/>
 185                 <arg line="${javatest.opt}"/>
 186                 <arg line="-writeReport -type html -filter allTests ${reportdir}/html"/>
 187             </java>
 188 
 189         </sequential>
 190     </macrodef>
 191 
 192         <target name="trickcase1" if="singletest.path">
 193                 <echo message="Run single test with name ${singletest.path}" />
 194                 <replace file="${jti}" token="tests.needTests=No" value="tests.needTests=Yes"/>


  11  * by Oracle in the LICENSE file that accompanied this code.
  12  *
  13  * This code is distributed in the hope that it will be useful, but WITHOUT
  14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  16  * version 2 for more details (a copy is included in the LICENSE file that
  17  * accompanied this code).
  18  *
  19  * You should have received a copy of the GNU General Public License version
  20  * 2 along with this work; if not, write to the Free Software Foundation,
  21  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  22  *
  23  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  24  * or visit www.oracle.com if you need additional information or have any
  25  */
  26 -->
  27 <project name="javatest_utility_macro" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
  28     <dirname property="jclient.root.dir" file="${ant.file.fxprobe}"/>
  29     <import file="nbproject/build-impl.xml"/>
  30 
  31     <condition property="java.executable" value="java.exe" else="java">

  32         <os family="windows" />

  33     </condition>

  34     

  35     <macrodef name="run-javatest">
  36         <attribute name="testmode"/>
  37         <sequential>
  38             <echo message="Executing tools/FxTestRunner/run_javatest_macro.xml" />

  39             <echo message="testmode = @{testmode}" />
  40             <echo message="Javatest Basedir = ${fxtest.basedir}" />
  41             <echo message="external.output = ${external.output}" />
  42             
  43             <fail message="fxtest.basedir not set" unless="fxtest.basedir" />
  44             <property name="workdir" value="${fxtest.basedir}/workdir_@{testmode}"/>
  45             <property name="reportdir" value="${fxtest.basedir}/reportdir_@{testmode}"/>
  46             <!-- default values -->
  47             <property name="javatest.runmode" value="desktop"/>
  48             <property name="javatest.pipelineGroup" value="Hardware(Default)"/>
  49             <!-- find utils -->
  50             <property name="javatest.jar" value="${jclient.root.dir}/../../tools/lib/javatest.jar"/>
  51             <property name="HtmlTestRunner.jar" value="${jclient.root.dir}/../../tools/HtmlTestRunner/dist/HtmlTestRunner.jar"/>
  52 
  53             <!-- JTI MAGIC -->
  54             
  55             <!-- step 0: jti file's names -->
  56             <property name="fxsqe.jti.base" value="${jclient.root.dir}/../../tools/FxTestRunner/javatest_base/@{testmode}.jti.base" />
  57             <property name="fxsqe.jti.suite-specific" value="${basedir}/javatest_files/@{testmode}.jti" />
  58             <property name="jti" value="${fxtest.basedir}/@{testmode}.jti"/>
  59 
  60             <!-- step 1: load properties (non-override rule) in next order: -Dfxsqe.name, fxsqe.jti.suite-specific -->
  61             <property file="${fxsqe.jti.base}" prefix="javatest"/>
  62 
  63             <!-- step 2: load filters (override works) in next order: fxsqe.jit.base, fxsqe.jti.suite-specific -->
  64             <filter filtersfile="${fxsqe.jti.base}" />
  65             <filter filtersfile="${fxsqe.jti.suite-specific}" />
  66 
  67             <!-- step 3: apply run-specific values to filters. Unset values are preloaded in step 1. -->
  68             <filter token="runmode" value="${javatest.runmode}"/>
  69             <filter token="pipelineGroup" value="${javatest.pipelineGroup}"/>
  70             <filter token="browserPath" value="${javatest.browserPath}"/>
  71             <filter token="javawsPath" value="${javatest.javawsPath}"/>
  72             <filter token="vmOptions" value="${javatest.vmOptions}"/>
  73             <filter token="dryrun" value="${javatest.dryrun}"/>
  74             
  75             <condition property="__addExportsEnabled" value="No" else="Yes">

  76                 <isset property="noAddExports" />      

  77             </condition>            

  78             <filter token="addExportsEnabled" value="${__addExportsEnabled}"/>

  79 

  80             <!-- step 4: set the rest of filters-->
  81 
  82             <condition property="javafx.home" value="${javafx.rt}">
  83             <not>
  84                 <isset property="javafx.home"/>
  85             </not>
  86             </condition>
  87             <pathconvert targetos="unix" property="javafx.home.converted">
  88                 <path location="${javafx.home}"/>
  89             </pathconvert>
  90             <pathconvert targetos="unix" property="javafx.home.remote.converted">

  91                 <path location="${javafx.home.remote}"/>

  92             </pathconvert>

  93             <pathconvert targetos="unix" property="javaPath.converted">

  94                 <path location="${javafx.home}/bin/${java.executable}"/>

  95             </pathconvert>

  96             
  97             <condition property="fvalue.javafx.home" value="${javafx.home.remote.converted}" else="${javafx.home.converted}">

  98                 <isset property="javafx.home.remote"/>
  99             </condition>
 100             <condition property="fvalue.remote" value="Yes" else="No">
 101                 <isset property="javafx.home.remote"/>
 102             </condition>
 103             <condition property="fvalue.javaPath" value="javaPath=java" else="javaPath=${javaPath.converted}">

 104                 <isset property="javafx.home.remote"/>
 105             </condition>
 106 
 107             <filter token="javafx.home" value="${fvalue.javafx.home}"/>
 108             <filter token="remote" value="${fvalue.remote}"/>
 109             <filter token="javaPath=" value="${fvalue.javaPath}"/>
 110 
 111             <pathconvert targetos="unix" property="TESTSUITE.converted">

 112                 <path location="${basedir}/${test.sources}"/>

 113             </pathconvert>

 114             <filter token="TESTSUITE" value="${TESTSUITE.converted}"/>

 115             

 116             <pathconvert targetos="unix" property="workdir.converted">

 117                 <path location="${workdir}"/>

 118             </pathconvert>

 119             <filter token="WORKDIR" value="${workdir.converted}"/>

 120             

 121             <pathconvert targetos="unix" property="fxtest.basedir.converted">

 122                 <path location="${fxtest.basedir}"/>

 123             </pathconvert>           

 124             <filter token="external.output" value="${fxtest.basedir.converted}"/>

 125 
 126             <!-- step 5: copy template with applied filters -->
 127             <copy overwrite="true" filtering="true" file="${jclient.root.dir}/../../tools/FxTestRunner/javatest_base/@{testmode}.jti.template" tofile="${jti}"/>
 128 
 129             <!-- step 5: add Vera's tricks -->
 130             <antcall target="trickcase1"/>
 131             <antcall target="trickcase2"/>
 132             <!-- END OF JTI MAGIC -->    
 133                 
 134             <!-- classpath -->
 135             <property name="client.test.root" value="${basedir}/${test.sources}"/>
 136             <property name="javatest.classpath" value="${jclient.root.dir}/../../tools/FxTestRunner/dist/FxTestRunner.jar:${javatest.jar}:${HtmlTestRunner.jar}:${build.test.classes.dir}:${javac.test.classpath}:${jclient.root.dir}/../../tools/lib/jetty-all.jar:${jclient.root.dir}/../../tools/SharedTestUtilsOpen/dist/SharedTestUtilsOpen.jar:${jclient.root.dir}/../../tools/lib/servlet-api.jar"/>
 137             <echo message="classpath=${javatest.classpath}"/>
 138 
 139             <!-- agent / utility mode stuff -->
 140             <condition property="javatest.opt" value="-batch" else="">
 141                 <equals arg1="${javatest.mode.batch}" arg2="true" />
 142             </condition>
 143             <condition property="javatest.agent.pool" value="-startAgentPool" else="">
 144                 <isset property="javafx.home.remote"/>
 145             </condition>
 146 
 147             <!-- run javatest -->
 148        
 149             <mkdir dir="${workdir}"/>
 150             <!-- update defaults --> 
 151 
 152             <condition property="javatest.debug.jvmargs" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5858" else="">
 153                 <isset property="javatest.debug"/>
 154             </condition>
 155 
 156             <property name="javatest.java" value="java"/>   
 157 
 158             <java classpath="${javatest.classpath}"
 159                   classname="com.sun.javatest.tool.Main" fork="true" failonerror="false" jvm="${javatest.java}">
 160                 <jvmarg line="${javatest.debug.jvmargs}"/>
 161                                 <jvmarg line="-XX:+IgnoreUnrecognizedVMOptions"/>

 162                 <jvmarg line="--add-exports javafx.graphics/com.sun.javafx.util=ALL-UNNAMED"/>

 163                 <jvmarg line="-Dsun.reflect.debugModuleAccessChecks=true -XX:+TraceAccessControlErrors"/>

 164                 <sysproperty key="client.test.root" value="${client.test.root}"/>
 165                 <sysproperty key="javatest.security.noSecurityManager" value="true"/>
 166                 <sysproperty key="client.exclude.nodesc" value="${exclude.nodesc}"/>
 167                 <sysproperty key="client.exclude.desc" value="${exclude.desc}"/>
 168                 <sysproperty key="javatest.FXProcessCommand.verbose" value="${javatest.FXProcessCommand.verbose}"/>
 169                 <arg line="-config"/>
 170                 <arg line="${jti}"/>
 171                 <arg line="-workdir"/>
 172                 <arg line="${workdir}"/>
 173                 <arg line="-testsuite"/>
 174                 <arg line="${basedir}/${test.sources}"/>
 175                 <arg line="${javatest.opt}"/>
 176                 <arg line="${javatest.agent.pool}"/>
 177             </java>
 178 
 179             <delete includeEmptyDirs="true" failonerror="false">
 180                 <fileset dir="${reportdir}"/>
 181             </delete>
 182             <mkdir dir="${reportdir}"/>
 183             <echo message="Writing TXT report"/>
 184             <java classpath="${javatest.classpath}"
 185                   classname="com.sun.javatest.tool.Main" fork="true" failonerror="false" jvm="${javatest.java}">
 186                 <jvmarg line="-XX:+IgnoreUnrecognizedVMOptions"/>

 187                 <jvmarg line="--add-exports javafx.graphics/com.sun.javafx.util=ALL-UNNAMED"/>

 188                 <jvmarg line="-Dsun.reflect.debugModuleAccessChecks=true -XX:+TraceAccessControlErrors"/>

 189                 <sysproperty key="client.test.root" value="${client.test.root}"/>
 190                 <sysproperty key="javatest.security.noSecurityManager" value="true"/>
 191                 <sysproperty key="client.exclude.nodesc" value="${exclude.nodesc}"/>
 192                 <sysproperty key="client.exclude.desc" value="${exclude.desc}"/>
 193                 <arg line="-config"/>
 194                 <arg line="${jti}"/>
 195                 <arg line="-workdir"/>
 196                 <arg line="${workdir}"/>
 197                 <arg line="-testsuite"/>
 198                 <arg line="${basedir}/${test.sources}"/>
 199                 <arg line="${javatest.opt}"/>
 200                 <arg line="-writeReport -type txt -filter allTests ${reportdir}"/>
 201             </java>
 202             <echo message="Writing HTML report"/>
 203             <java classpath="${javatest.classpath}"
 204                   classname="com.sun.javatest.tool.Main" fork="true" failonerror="false" jvm="${javatest.java}">
 205                 <jvmarg line="-XX:+IgnoreUnrecognizedVMOptions"/>

 206                 <jvmarg line="--add-exports javafx.graphics/com.sun.javafx.util=ALL-UNNAMED"/>

 207                 <jvmarg line="-Dsun.reflect.debugModuleAccessChecks=true -XX:+TraceAccessControlErrors"/>

 208                 <sysproperty key="client.test.root" value="${client.test.root}"/>
 209                 <sysproperty key="javatest.security.noSecurityManager" value="true"/>
 210                 <sysproperty key="client.exclude.nodesc" value="${exclude.nodesc}"/>
 211                 <sysproperty key="client.exclude.desc" value="${exclude.desc}"/>
 212                 <arg line="-config"/>
 213                 <arg line="${jti}"/>
 214                 <arg line="-workdir"/>
 215                 <arg line="${workdir}"/>
 216                 <arg line="-testsuite"/>
 217                 <arg line="${basedir}/${test.sources}"/>
 218                 <arg line="${javatest.opt}"/>
 219                 <arg line="-writeReport -type html -filter allTests ${reportdir}/html"/>
 220             </java>
 221 
 222         </sequential>
 223     </macrodef>
 224 
 225         <target name="trickcase1" if="singletest.path">
 226                 <echo message="Run single test with name ${singletest.path}" />
 227                 <replace file="${jti}" token="tests.needTests=No" value="tests.needTests=Yes"/>