| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| <project basedir="." default="all" name="changeme"> |
| <property name="netbeans.home" location="../../../nbbuild/netbeans"/> |
| <!--the directory where the script will find ide.cfg files to start |
| netbeans with --> |
| <property name="configdir" value="configfiles"/> |
| <!--the directory where *generated* data should go log files, |
| subdirectories for each test run, etc, log files for later |
| parsing, serialized data --> |
| <property name="reportdir" location="report"/> |
| <!--the directory that will be used as the user directory for the |
| runs of NetBeans --> |
| <property name="userdir" location="userdir"/> |
| <property name="ant.home" location="../../../nbbuild/external/ant-1.4.1.jar"/> |
| <!-- the DateFormat string for dates that are logged into log files --> |
| <property name="logtime.pattern" value="yyyy.MM.dd hh:mm:ss:S z"/> |
| <!-- the prefix string for garbage collection log files (e.g. gclog_1, gclog_2) --> |
| <property name="gclogname" value="gclog"/> |
| <!--the filename for the initial report generated by running the IDE. This |
| is not really a human readable report, just a bunch of pointers to |
| log files for each test--> |
| <property name="reportname" value="outdata.dat"/> |
| <!--filename for the defunct html report task --> |
| <property name="outfilename" value="gcreport"/> |
| <!--name (to write into the log) for this type of test. Will be more |
| useful to specify dynamically, once test types are decoupled from |
| the runner --> |
| <property name="test-set-name" value="GC Tuning"/> |
| <!--The directory to output html reports and such into--> |
| <property name="htmldir" value="html"/> |
| <!--Separator string for test sets in the log files this script |
| generates (outdata.dat files)--> |
| <property name="separator.testsets" value="%%%"/> |
| <!--Separator string for data within a test set in the log files this |
| script generates (outdata.dat files)--> |
| <property name="separator.testdata" value="^^^"/> |
| <!--The number of times each test should be run for averaging results |
| and eliminating anomolies. Script will run each test in configdir/ |
| count times--> |
| <property name="count" value="10"/> |
| <!--Name prefix for the time (start and end time) logs generated by |
| this script--> |
| <property name="timelogname" value="timelog"/> |
| |
| <target name="all" depends="buildtasks,setup,test-configs,genoutput,cooldown" description= |
| "Run garbage collection tests"/> |
| |
| <target name="foreachfile"> |
| <javac srcdir="src/" destdir="src/" includes="ForEachFileTask"> |
| <classpath> |
| <pathelement location="${ant.home}"/> |
| <pathelement location="src"/> |
| </classpath> |
| </javac> |
| <taskdef name="foreachfile" classname="org.netbeans.performance.antext.ForEachFileTask"> |
| <classpath> |
| <pathelement location="src"/> |
| </classpath> |
| </taskdef> |
| </target> |
| |
| <target name="iteratingtask"> |
| <javac srcdir="src/" destdir="src/" includes="IteratingTask"> |
| <classpath> |
| <pathelement location="${ant.home}"/> |
| <pathelement location="src"/> |
| </classpath> |
| </javac> |
| <taskdef name="iteratingtask" classname="org.netbeans.performance.antext.IteratingTask"> |
| <classpath> |
| <pathelement location="src"/> |
| </classpath> |
| </taskdef> |
| </target> |
| |
| <target name="clean"> |
| <delete dir="${reportdir}"/> |
| <delete dir="${htmldir}"/> |
| <antcall target="delete-userdir"/> |
| <!--remove the report directory |
| remove the ide.cfg file --> |
| </target> |
| |
| <target name="delete-userdir"> |
| <!--XXX find a way to preserve the userdir--> |
| <delete dir="${userdir}"/> |
| </target> |
| |
| |
| <target name="warmup" |
| description="Start the IDE thrice to load the disk cache and create the initial userdir contents, get Hotspot to compile away Ant overhead for consistency, etc." |
| depends="create-userdir,add-userdir"> |
| <echo>Warmup 1 - running IDE once to prime disk and memory caches and create userdir</echo> |
| |
| <exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" |
| executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000"> |
| <arg value="-J-Dnetbeans.close=true"/> |
| </exec> |
| |
| <exec os="Linux SunOS Solaris" dir="." executable="sh" failonerror="yes" timeout="600000"> |
| <arg value="${netbeans.home}/bin/runide.sh"/> |
| <arg value="-J-Dnetbeans.close=true"/> |
| </exec> |
| |
| <echo>Warmup 2 - running IDE a second time prime disk and memory caches and create userdir</echo> |
| <exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" |
| executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000"> |
| <arg value="-J-Dnetbeans.close=true"/> |
| </exec> |
| |
| <exec os="Linux SunOS Solaris" dir="." executable="sh" failonerror="yes" timeout="600000"> |
| <arg value="${netbeans.home}/bin/runide.sh"/> |
| <arg value="-J-Dnetbeans.close=true"/> |
| </exec> |
| </target> |
| |
| <!--moved compilation steps here to get out of the way and out of memory ahead of |
| time in case they could affect tests--> |
| <!--XXX put warmup task back--> |
| <target name="setup" depends="clean,backup-idecfg,create-report-directory,create-userdir,warmup,begin-test-set" |
| description="Prepare environment for running tests"/> |
| |
| <target name="backup-idecfg"> |
| <!--create file if missing so copy does not cause tests to bomb out--> |
| <echo file="${netbeans.home}/bin/ide.cfg" append="true"> |
| </echo> |
| <copy file="${netbeans.home}/bin/ide.cfg" tofile="${netbeans.home}/bin/ide.cfg.perftestbackup"/> |
| <delete file="${netbeans.home}/bin/ide.cfg"/> |
| <!--create file if missing so copy does not cause tests to bomb out--> |
| <echo file="${netbeans.home}/bin/ide.log" append="true" message=""/> |
| <copy file="${netbeans.home}/bin/ide.log" tofile="${netbeans.home}/bin/ide.log.perftestbackup"/> |
| <delete file="${netbeans.home}/bin/ide.log"/> |
| </target> |
| |
| <target name="create-report-directory"> |
| <mkdir dir="${reportdir}"/> |
| </target> |
| |
| <target name="create-userdir"> |
| <!--XXX find a way to make this conditional on keep.userdir--> |
| <mkdir dir="${userdir}"/> |
| </target> |
| |
| <target name="begin-test-set"> |
| <echo append="true" file="${reportdir}/${reportname}/" |
| message="TEST_SET:${test-set-name}${separator.testsets}"/> |
| |
| <!--XXX FIXME: hard coded - should instead gather |
| this info with a shell script which could later be wrapped. --> |
| <echo append="true" file="${reportdir}/${reportname}/" |
| message="PLATFORM:Solaris 5.8${separator.testsets}"/> |
| |
| <!--XXX FIXME: hard coded - should instead gather |
| this info with a shell script which could later be wrapped. --> |
| <echo append="true" file="${reportdir}/${reportname}/" |
| message="PLATFORM_CONFIG:Unknown${separator.testsets}"/> |
| |
| </target> |
| |
| <target name="test-configs" depends="setup,foreachfile" |
| description="Test all of the config files in the config directory, logging results"> |
| <!--update with foreachdir so that configuration sets can be tested--> |
| <property name="reportfile" location="${reportdir}/${reportname}"/> |
| <foreachfile target="iterate-one-config"> |
| <fileset dir="${configdir}"> |
| <include name="*"/> |
| </fileset> |
| </foreachfile> |
| <antcall target="finish-test-set"/> |
| </target> |
| |
| <target name="iterate-one-config" depends="iteratingtask"> |
| <property name="cfgdir" location="${reportdir}/${configfile_unqualified}"/> |
| <property name="timelog" location="${cfgdir}/${timelogname}"/> |
| <property name="gclog" location="${reportdir}/${configfile_unqualified}/${gclogname}"/> |
| |
| <antcall target="begin-report" inheritAll="true"/> |
| <iteratingtask count="${count}" target="test-one-config"> |
| </iteratingtask> |
| </target> |
| |
| <target name="test-one-config"> |
| <echo>Testing ${configfile_unqualified} iteration ${index} |
| </echo> |
| |
| <antcall target="prepare-one-test" inheritAll="true"/> |
| <antcall target="run-one-test" inheritAll="true"> |
| </antcall> |
| </target> |
| |
| <target name="prepare-one-test" |
| depends="copy-next-config-file,add-killargument,add-userdir,add-verbose-gcflags,create-report-subdir,copy-configfile-to-subdir" |
| description="Set up environment for a single test"/> |
| |
| <target name="copy-next-config-file"> |
| <delete file="${netbeans.home}/bin/ide.cfg"/> |
| <echo> |
| Copying config file ${configfile} to ${netbeans.home}/bin/ide.cfg |
| </echo> |
| <copy file="${configfile}" tofile="${netbeans.home}/bin/ide.cfg"/> |
| </target> |
| |
| <target name="add-killargument"> |
| <echo file="${netbeans.home}/bin/ide.cfg" append="true"> |
| -J-Dnetbeans.close=true </echo> |
| </target> |
| |
| <target name="add-verbose-gcflags"> |
| <echo file="${netbeans.home}/bin/ide.cfg" append="true"> |
| -J-verbose:gc </echo> |
| </target> |
| |
| <target name="add-userdir"> |
| <echo file="${netbeans.home}/bin/ide.cfg" append="true"> |
| -userdir ${userdir} </echo> |
| </target> |
| |
| <target name="copy-configfile-to-subdir"> |
| <copy file="${configfile}" tofile="${cfgdir}/ide.cfg"/> |
| </target> |
| |
| <target name="create-report-subdir"> |
| <mkdir dir="${cfgdir}"/> |
| </target> |
| |
| <target name="begin-report"> |
| <!--XXX - should not need to redefine cfgdir here--> |
| <!-- <property name="cfgdir" location="${reportdir}/${configfile_unqualified}"/> --> |
| <echo append="true" file="${reportfile}" |
| message="TEST_RUN:${configfile_unqualified}${separator.testdata}"/> |
| <echo append="true" file="${reportfile}" |
| message="LOGFILE:${cfgdir}/ide.log${separator.testdata}"/> |
| <echo append="true" file="${reportfile}" |
| message="CONFIG:${cfgdir}/ide.cfg${separator.testdata}"/> |
| <echo append="true" file="${reportfile}" |
| message="GCLOG:${cfgdir}/gclog${separator.testdata}"/> |
| <echo append="true" file="${reportfile}" |
| message="TIMELOG:${timelog}${separator.testsets}"/> |
| </target> |
| |
| <target name="run-one-test"> |
| <echo>Testing ${configfile}</echo> |
| <antcall target="create-report-subdir" inheritAll="true"/> |
| <antcall target="log-start-time" inheritAll="true"/> |
| <antcall target="runide" inheritAll="true"/> |
| <antcall target="log-end-time" inheritAll="true"/> |
| <antcall target="copy-log-file" inheritAll="true"/> |
| </target> |
| |
| <target name="finish-test-set"> |
| <echo> |
| Test {configfile_unqualified} completed</echo> |
| <echo file="${reportdir}/${reportname}/" append="true" |
| message="${separator.testsets}"/> |
| </target> |
| |
| <target name="log-start-time"> |
| <echo> Timelog = ${timelog}</echo> |
| <tstamp> |
| <format pattern="${logtime.pattern}" property="timestamp"/> |
| </tstamp> |
| <echo file="${timelog}_${index}" append="true" |
| message="START:${timestamp}${separator.testdata}"/> |
| </target> |
| |
| <target name="log-end-time"> |
| <property name="timelog" location="${cfgdir}/${timelogname}_${index}"/> |
| <tstamp> |
| <format property="timestamp" pattern="${logtime.pattern}"/> |
| </tstamp> |
| <echo file="${timelog}_${index}" append="true" |
| message="END:${timestamp}${separator.testdata}"/> |
| </target> |
| |
| <target name="copy-log-file"> |
| <echo> |
| Copying ide.log</echo> |
| <!--create file if missing so copy does not cause tests to bomb out--> |
| <echo file="${netbeans.home}/bin/ide.log" append="true" message=""/> |
| <copy file="${userdir}/system/ide.log" todir="${cfgdir}"/> |
| <delete file="${userdir}/system/ide.log"/> |
| </target> |
| |
| |
| <target name="runide-freshuserdir" depends="delete-userdir,create-userdir,runide" /> |
| |
| <target name="runide" description="Start the IDE with the userdir specified in the userdir property"> |
| <exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" |
| executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000" |
| output="${gclog}_${index}"> |
| </exec> |
| |
| <exec os="Linux SunOS Solaris" dir="." executable="sh" failonerror="yes" timeout="600000" |
| output="${gclog}_${index}"> |
| <arg value="${netbeans.home}/bin/runide.sh"/> |
| </exec> |
| </target> |
| |
| |
| <target name="runide-uitests" description="Start the IDE and run the QA tests"> |
| |
| <!--output file for the ant process (just in case)--> |
| <property name="qaoutfile" value="${cfgdir}/${gclogname}.antout_${index}"/> |
| |
| <ant dir="../../qa/test" antfile="../../qa/test/build.xml" output="${qaoutfile}"> |
| <property name="xtest.outputfile" location="${gclog}_${index}"/> |
| <property name="xtest.userdir" location="${userdir}"/> |
| <property name="xtest.testtype" value="qa-functional"/> |
| <property name="xtest.attribs" value="validation"/> |
| </ant> |
| </target> |
| |
| |
| |
| <target name="cooldown" description="Restore the universe to order" |
| depends="restore-idecfg"/> |
| |
| <target name="restore-idecfg"> |
| <echo> |
| Removing generated ide.cfg file |
| </echo> |
| <delete file="${netbeans.home}/bin/ide.cfg"/> |
| <echo> |
| Removing test userdir |
| </echo> |
| <delete dir="${userdir}"/> |
| <echo> |
| Restoring original ide.cfg file |
| </echo> |
| <copy file="${netbeans.home}/bin/ide.cfg.perftestbackup" tofile="${netbeans.home}/bin/ide.cfg"/> |
| <echo> |
| Deleting temporary backup ide.cfg file |
| </echo> |
| <delete file="${netbeans.home}/bin/ide.cfg.perftestbackup"/> |
| <echo> |
| Restoring original ide.log file |
| </echo> |
| <copy tofile="${netbeans.home}/bin/ide.log" file="${netbeans.home}/bin/ide.log.perftestbackup"/> |
| <echo> |
| Deleting backup ide.log file |
| </echo> |
| <delete file="${netbeans.home}/bin/ide.log.perftestbackup"/> |
| </target> |
| |
| <target name="analyze" depends="buildtasks" description="Generate an html report"> |
| <mkdir dir="${htmldir}"/> |
| <property name="outdir" location="${htmldir}"/> |
| <tstamp> |
| <format pattern="yyyyMMddhhmm" property="timestamp"/> |
| </tstamp> |
| |
| <echo> |
| Generating report ${outdir}/${outfilename}.html</echo> |
| <report datafile="${reportdir}/${reportname}" |
| outfile="${outdir}/${outfilename}.html" |
| dateformat="${logtime.pattern}"/> |
| </target> |
| |
| <target name="genserializeddata" depends="buildtasks"> |
| <genrunsdata datafile="${reportdir}/${reportname}" outfile="${reportdir}/logs.ser"/> |
| </target> |
| |
| <target name="genoutput" depends="genserializeddata"> |
| <mkdir dir="${htmldir}"/> |
| <gccharts datafile="${reportdir}/logs.ser" outdir="${htmldir}"/> |
| </target> |
| |
| <target name="buildtasks"> |
| <javac srcdir="src" destdir="src" debug="true"> |
| <classpath> |
| <pathelement location="src/"/> |
| <fileset dir="lib/ext"> |
| <include name="lib/ext/jcommon-0.7.0.jar"/> |
| <include name="lib/ext/jtreechart-0.9.3.jar"/> |
| </fileset> |
| </classpath> |
| </javac> |
| <taskdef name="gccharts" classname="org.netbeans.performance.impl.analysis.GcCharts"> |
| <classpath> |
| <pathelement location="src/"/> |
| <fileset dir="lib/ext"> |
| <include name="lib/ext/jcommon-0.7.0.jar"/> |
| <include name="lib/ext/jtreechart-0.9.3.jar"/> |
| </fileset> |
| </classpath> |
| </taskdef> |
| <taskdef name="foreachfiletask" classname="org.netbeans.performance.antext.ForEachFileTask"> |
| <classpath> |
| <pathelement location="src"/> |
| </classpath> |
| </taskdef> |
| <taskdef name="genrunsdata" classname="org.netbeans.performance.impl.analysis.GenRunsData"> |
| <classpath> |
| <pathelement location="src/"/> |
| </classpath> |
| </taskdef> |
| |
| </target> |
| |
| <target name="get-jfreechart"> |
| <property name="libdir" location="lib/ext"/> |
| <echo> |
| Downloading JFreeChart and common libraries from sourceforge.net. These |
| libraries cannot be hosted on netbeans.org for licensing reasons. |
| |
| If this download fails (perhaps because you are behind a firewall), |
| you can either run |
| |
| ant -DproxySet=true -DproxyHost=some.proxy.url -DproxyPort=[a port number here] |
| |
| (you can also put these settings in the ANT_OPTS environment variable) |
| or you can download the libraries manually from |
| http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jfreechart-0.9.3.tar.gz |
| and |
| http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jcommon-0.7.0.tar.gz |
| and put them in the lib/ext subdirectory of ${libdir} |
| </echo> |
| <!-- <setproxy proxyhost="${proxy}" proxyport="${proxyport}"/> --> |
| <get src="http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jfreechart-0.9.3.tar.gz" |
| dest="/tmp/jfreechart-0.9.3.tar.gz" verbose="yes"/> |
| <get src="http://cesnet.dl.sourceforge.net/sourceforge/jfreechart/jcommon-0.7.0.tar.gz" |
| dest="/tmp/jcommon-0.7.0.tar.gz" verbose="yes"/> |
| <gunzip src="/tmp/jcommon-0.7.0.tar.gz" dest="/tmp"/> |
| <gunzip src="/tmp/jfreechart-0.9.3.tar.gz" dest="/tmp"/> |
| <untar src="/tmp/jcommon-0.7.0.tar"/> |
| <untar src="/tmp/jfreechart-0.9.3.tar" dest="/tmp"/> |
| <copy todir="lib/ext" file="/tmp/jfreechart-0.9.3/jcommon-0.7.0.jar"/> |
| <copy todir="lib/ext" file="/tmp/jcommon-0.7.0/jfreechart-0.9.3.jar"/> |
| </target> |
| |
| <!-- |
| <target name="reportengine"> |
| <javac srcdir="lib/antext" destdir="lib/antext" debug="true"> |
| <classpath> |
| <pathelement location="${ant.home}"/> |
| <pathelement location="lib/ext/jcommon-0.7.0.jar"/> |
| <pathelement location="lib/ext/jtreechart-0.9.3.jar"/> |
| </classpath> |
| </javac> |
| <taskdef name="report" classname="nbperf.ReportEngine"> |
| <classpath> |
| <pathelement location="lib/antext"/> |
| <pathelement location="lib/ext/jcommon-0.7.0.jar"/> |
| <pathelement location="lib/ext/jtreechart-0.9.3.jar"/> |
| </classpath> |
| </taskdef> |
| </target> --> |
| |
| <!-- |
| |
| <target name="checkchartlib"> |
| <javac srcdir="lib/antext" destdir="lib/antext" debug="true"> |
| <classpath> |
| <pathelement location="${ant.home}"/> |
| </classpath> |
| </javac> |
| <taskdef name="checkchartlib" classname="nbperf.CheckForJFreeChart"> |
| <classpath> |
| <pathelement location="lib/antext"/> |
| </classpath> |
| </taskdef> |
| </target> |
| |
| <target name="compilecharttask"> |
| <javac srcdir="lib/antext" destdir="lib/antext" debug="true"> |
| <classpath> |
| <pathelement location="${ant.home}"/> |
| </classpath> |
| </javac> |
| <taskdef name="buildcharts" classname="nbperf.CheckForJFreeChart"> |
| <classpath> |
| <pathelement location="lib/antext"/> |
| </classpath> |
| </taskdef> |
| </target> |
| |
| <target name="createcharts" depends="checkchartlib"> |
| <antcall target="compilecharttask"/> |
| <property |
| </target> |
| |
| --> |
| |
| |
| </project> |