david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 2 | <project |
| 3 | name="testsuite" |
| 4 | default="run" |
| 5 | basedir="."> |
| 6 | <!-- |
| 7 | ===================================================== There |
| 8 | should be no need to change what's above. (if there is, let us |
| 9 | know if the script can be improved.) |
| 10 | ===================================================== |
| 11 | --> |
| 12 | <!-- |
| 13 | Every suite needs to specify three thing: plugin-name, classname |
| 14 | - that provides the suite to test, and testType - either |
| 15 | core-test, or ui-test. There is an optional extraVMargs property |
| 16 | that some tests need to use in order to specify extra, |
| 17 | non-standard properties to the VM when it runs. If not need, no |
| 18 | need to specify it. |
| 19 | --> |
| 20 | <property |
| 21 | name="plugin-name" |
| 22 | value="org.eclipse.wtp.releng.tests"/> |
| 23 | <property |
| 24 | name="classname" |
| 25 | value="org.eclipse.wtp.releng.tests.TestBuild"/> |
| 26 | <property |
| 27 | name="testType" |
| 28 | value="core-test"/> |
| 29 | <!-- |
| 30 | some test suites need to add special vm arguments when they run. |
| 31 | This is just an example. <property name="extraVMargs" |
| 32 | value="-DjsfRuntimeJarsDirectoryV1.1=${testDir}/${jsf1.1Dir}" /> |
| 33 | <echo message="extraVMargs ${extraVMargs}" /> |
| 34 | --> |
| 35 | <!-- |
david_williams | e8b7dee | 2009-11-26 19:05:59 +0000 | [diff] [blame] | 36 | There should be no need to change what's below. (if there is, let us |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 37 | know if the script can be improved.) |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 38 | --> |
| 39 | <!-- |
| 40 | There are some properties that must be provided by caller. |
| 41 | --> |
| 42 | <fail |
| 43 | message="Error: missing property. eclipse-home must be provided" |
| 44 | unless="eclipse-home"/> |
| 45 | <fail |
| 46 | message="Error: missing property. buildDirectory must be provided" |
| 47 | unless="buildDirectory"/> |
| 48 | <fail |
| 49 | message="Error: missing property. buildLabel must be provided" |
| 50 | unless="buildLabel"/> |
david_williams | e8b7dee | 2009-11-26 19:05:59 +0000 | [diff] [blame] | 51 | <fail |
| 52 | message="Error: missing property. library-file must be provided" |
| 53 | unless="library-file"/> |
| 54 | |
| 55 | |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 56 | <echo |
| 57 | message="basedir: ${basedir}"/> |
| 58 | <echo |
| 59 | message="eclipse-home: ${eclipse-home}"/> |
| 60 | <echo |
| 61 | message="buildDirectory: ${buildDirectory}"/> |
| 62 | <echo |
| 63 | message="buildLabel: ${buildLabel}"/> |
| 64 | <echo |
| 65 | message="plugin-name: ${plugin-name}"/> |
| 66 | <echo |
| 67 | message="classname: ${classname}"/> |
| 68 | <echo |
| 69 | message="testType ${testType}"/> |
| 70 | <echo |
| 71 | message="buildId ${buildId}"/> |
david_williams | e8b7dee | 2009-11-26 19:05:59 +0000 | [diff] [blame] | 72 | |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 73 | <property |
| 74 | name="workspace" |
| 75 | value="${eclipse-home}/junitworkspaces/${plugin-name}"/> |
| 76 | <!-- |
| 77 | This init target holds all initialization code that needs to be |
| 78 | done for all tests that are to be run. Initialization for |
| 79 | individual tests should be done within the body of the suite |
| 80 | target. Here it's a good idea to delete things that might have |
| 81 | been created if the test has already been ran, just in case the |
| 82 | test is being re-ran. |
| 83 | --> |
| 84 | <target |
| 85 | name="init"> |
| 86 | <tstamp/> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 87 | <delete> |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 88 | <fileset |
| 89 | dir="${eclipse-home}" |
| 90 | includes="${plugin-name}.*xml"/> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 91 | </delete> |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 92 | <!-- |
| 93 | make the workspace directory, in case path doesn't exist yet |
| 94 | but delete to make sure fresh contents, if it does exist |
| 95 | --> |
| 96 | <delete |
| 97 | dir="${workspace}" |
| 98 | quiet="true"/> |
| 99 | <mkdir |
david_williams | 9ef9f65 | 2009-11-17 18:37:27 +0000 | [diff] [blame] | 100 | dir="${workspace}"/> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 101 | </target> |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 102 | <!-- |
| 103 | This suite target defines the tests that need to be run. |
| 104 | --> |
| 105 | <target |
| 106 | name="suite"> |
| 107 | <ant |
| 108 | target="${testType}" |
| 109 | antfile="${library-file}" |
| 110 | dir="${eclipse-home}"> |
| 111 | <property |
| 112 | name="data-dir" |
| 113 | value="${workspace}"/> |
| 114 | <property |
| 115 | name="plugin-name" |
| 116 | value="${plugin-name}"/> |
| 117 | <property |
| 118 | name="classname" |
| 119 | value="${classname}"/> |
| 120 | <property |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 121 | name="extraVMargs" |
david_williams | debabc5 | 2010-09-20 02:34:02 +0000 | [diff] [blame^] | 122 | value="-DrelengTestsPropertiesFile=${keyCfgFile} -DrepoURLToTest=file://${buildDirectory}/${buildLabel}/repository/ -DcomparatorLogLocation=${buildDirectory}/${buildLabel}/comparator.log -DsummaryLogDir=${junit-report-output} -DcomparatorFilterRules=${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/comparatorfilter.properties" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 123 | </ant> |
david_williams | 9ef9f65 | 2009-11-17 18:37:27 +0000 | [diff] [blame] | 124 | <condition |
| 125 | property="dotlogavailable"> |
| 126 | <available |
| 127 | file="${workspace}/.metadata/.log"/> |
| 128 | </condition> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 129 | </target> |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 130 | <!-- |
| 131 | This clean target holds code to cleanup the testing environment |
| 132 | after after all of the tests have been run. You can use this |
| 133 | target to delete temporary files that have been created, if |
| 134 | required. But, it's usually best to leave it all, in case you'd |
| 135 | like to inspect it after a failed run. It will be deleted |
| 136 | eventually by the next clean build. |
| 137 | --> |
| 138 | <target |
| 139 | name="cleanup"> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 140 | </target> |
david_williams | e24ea0d | 2009-11-16 13:59:54 +0000 | [diff] [blame] | 141 | <!-- |
| 142 | This run target is the master target that get's all the work |
| 143 | done. Most activity is actually done in the 'depends' tasks, but |
| 144 | any actions that need to happen after all the tests have been |
| 145 | run should go here, such as copying the results to a common |
| 146 | 'save' directory. |
| 147 | --> |
| 148 | <target |
| 149 | name="run" |
david_williams | 9ef9f65 | 2009-11-17 18:37:27 +0000 | [diff] [blame] | 150 | depends="init,suite,copylogs,copyxsl,cleanup"> |
| 151 | <echo |
| 152 | message="unit test ran: ${ant.file}"/> |
| 153 | <echo |
| 154 | message="library-file: ${library-file}"/> |
| 155 | </target> |
| 156 | <target |
| 157 | name="copylogs" |
| 158 | if="dotlogavailable"> |
| 159 | <copy |
| 160 | failonerror="false" |
| 161 | file="${workspace}/.metadata/.log" |
| 162 | tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt"/> |
| 163 | </target> |
| 164 | <target |
| 165 | name="copyxsl"> |
| 166 | <!-- copy our particular xsl files to web directory for prosperity--> |
| 167 | <copy |
| 168 | todir="${buildDirectory}/${buildLabel}/" |
| 169 | flatten="true"> |
| 170 | <fileset |
david_williams | da8765f | 2010-01-27 00:08:14 +0000 | [diff] [blame] | 171 | dir="${testRoot}"> |
david_williams | 9ef9f65 | 2009-11-17 18:37:27 +0000 | [diff] [blame] | 172 | <include |
david_williams | da8765f | 2010-01-27 00:08:14 +0000 | [diff] [blame] | 173 | name="**/org.eclipse.wtp.releng.tests*/versioningReportToHTML.xsl"/> |
david_williams | 9ef9f65 | 2009-11-17 18:37:27 +0000 | [diff] [blame] | 174 | </fileset> |
| 175 | </copy> |
| 176 | <!-- and use them to create basic display --> |
david_williams | 61cd327 | 2010-09-20 00:26:53 +0000 | [diff] [blame] | 177 | <xslt |
david_williams | 9ef9f65 | 2009-11-17 18:37:27 +0000 | [diff] [blame] | 178 | basedir="${buildDirectory}/${buildLabel}/" |
| 179 | includes="versioningReport_*" |
| 180 | destdir="${buildDirectory}/${buildLabel}/" |
| 181 | style="versioningReportToHTML.xsl" |
| 182 | force="true"/> |
| 183 | <echo |
| 184 | file="${buildDirectory}/${buildLabel}/versioningReportName.php"> |
| 185 | <![CDATA[<?php $versionReportFilename="versioningReport_${buildLabel}" ?>]]> |
| 186 | </echo> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 187 | </target> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 188 | </project> |