david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 3 | <project name="testsuite" default="run" basedir="."> |
| 4 | |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 5 | <!-- The following properties should be passed into this script --> |
| 6 | <!-- ${eclipse-home} --> |
| 7 | <!-- ${buildDirectory} --> |
| 8 | <!-- ${buildLabel} --> |
| 9 | |
| 10 | <!-- should be little need to change what's above --> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 11 | |
| 12 | <property name="plugin-name" |
| 13 | value="org.eclipse.wtp.releng.tests" /> |
| 14 | <property name="classname" |
| 15 | value="org.eclipse.wtp.releng.tests.TestBuild" /> |
| 16 | <property name="testType" value="core-test" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 17 | |
| 18 | <!-- should be little need to change what's below --> |
| 19 | |
| 20 | <echo message="basedir: ${basedir}" /> |
| 21 | <echo message="eclipse-home: ${eclipse-home}" /> |
| 22 | <echo message="buildDirectory: ${buildDirectory}" /> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 23 | <echo message="buildLabel: ${buildLabel}" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 24 | <echo message="plugin-name: ${plugin-name}" /> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 25 | <echo message="plugin-directory: ${testPlugin}" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 26 | <echo message="classname: ${classname}" /> |
| 27 | <echo message="testType ${testType}" /> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 28 | <echo message="buildId ${buildId}" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 29 | |
| 30 | |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 31 | <property name="library-file" |
| 32 | value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml" /> |
| 33 | <property name="workspace" |
| 34 | value="${eclipse-home}/junitworkspaces/${plugin-name}" /> |
| 35 | |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 36 | <!-- This target holds all initialization code that needs to be done for --> |
| 37 | <!-- all tests that are to be run. Initialization for individual tests --> |
| 38 | <!-- should be done within the body of the suite target. --> |
| 39 | <target name="init"> |
| 40 | <tstamp /> |
| 41 | <delete> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 42 | <fileset dir="${eclipse-home}" |
| 43 | includes="${plugin-name}.*xml" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 44 | </delete> |
| 45 | <!-- make directory, in case path doesn't exist yet --> |
| 46 | <mkdir dir="${workspace}" /> |
| 47 | <!-- but delete to make sure fresh contents--> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 48 | <delete dir="${workspace}" quiet="true" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 49 | |
| 50 | </target> |
| 51 | |
| 52 | <!-- This target defines the tests that need to be run. --> |
| 53 | <target name="suite"> |
| 54 | |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 55 | <ant target="${testType}" |
| 56 | antfile="${library-file}" |
| 57 | dir="${eclipse-home}"> |
| 58 | <property name="data-dir" |
| 59 | value="${workspace}" /> |
| 60 | <property name="plugin-name" |
| 61 | value="${plugin-name}" /> |
| 62 | <property name="classname" |
| 63 | value="${classname}" /> |
| 64 | <property name="plugin-path" |
| 65 | value="${eclipse-home}/plugins/${plugin-name}" /> |
| 66 | <property name="vmargs" |
| 67 | value="-DbuildDirectory='${buildDirectory}' -DbuildLabel='${buildLabel}'" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 68 | </ant> |
| 69 | |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 70 | <copy failonerror="false" |
| 71 | file="${workspace}/.metadata/.log" |
| 72 | tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 73 | |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 74 | <!-- copy our particular xsl to web directory for prosperity--> |
| 75 | <copy todir="${buildDirectory}/${buildLabel}/" |
| 76 | flatten="true"> |
| 77 | <fileset dir="${eclipse-home}/plugins/${testPlugin}" |
| 78 | includes="versioningReportToHTML.xsl" /> |
| 79 | </copy> |
| 80 | <!-- and use it to create basic display --> |
| 81 | <xslt basedir="${buildDirectory}/${buildLabel}/" |
| 82 | includes="versioningReport_*" |
| 83 | destdir="${buildDirectory}/${buildLabel}/" |
| 84 | style="versioningReportToHTML.xsl" |
| 85 | force="true" /> |
| 86 | |
| 87 | <echo file="${buildDirectory}/${buildLabel}/versioningReportName.php"> |
| 88 | <![CDATA[<?$versionReportFilename=versioningReport_${buildId}?>]]> |
| 89 | </echo> |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 95 | </target> |
| 96 | |
| 97 | <!-- This target holds code to cleanup the testing environment after --> |
| 98 | <!-- after all of the tests have been run. You can use this target to --> |
| 99 | <!-- delete temporary files that have been created. --> |
| 100 | <target name="cleanup"> |
| 101 | <!-- usually no need to delete workspace until next run, and leaving it allows inspection --> |
| 102 | <!-- <delete dir="${workspace}" quiet="true" /> --> |
| 103 | </target> |
| 104 | |
| 105 | <!-- This target runs the test suite. Any actions that need to happen --> |
| 106 | <!-- after all the tests have been run should go here. --> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 107 | <target name="run" depends="init,suite,cleanup"> |
| 108 | <ant target="collect" |
| 109 | antfile="${library-file}" |
| 110 | dir="${eclipse-home}"> |
| 111 | <property name="includes" |
| 112 | value="${plugin-name}.*xml" /> |
| 113 | <property name="output-file" |
| 114 | value="${plugin-name}.xml" /> |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 115 | </ant> |
david_williams | 3926e9f | 2006-12-09 08:23:14 +0000 | [diff] [blame^] | 116 | |
david_williams | d51e2f1 | 2006-12-07 08:19:46 +0000 | [diff] [blame] | 117 | </target> |
| 118 | |
| 119 | </project> |