david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 1 | <project |
| 2 | name="Automated Eclipse Testing" |
| 3 | default="all" |
| 4 | basedir="."> |
| 5 | <property |
| 6 | environment="env"/> |
| 7 | |
| 8 | <!-- required to get proper value of dropinsFolder --> |
| 9 | <property |
| 10 | name="keyCfgFile" |
| 11 | value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/> |
| 12 | <echo |
david_williams | 1543a9b | 2009-11-24 01:43:55 +0000 | [diff] [blame] | 13 | level="info" |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 14 | message="keyCfgFile: ${keyCfgFile}"/> |
| 15 | <property |
| 16 | file="${keyCfgFile}"/> |
| 17 | <echo |
| 18 | level="info" |
| 19 | message="starting Automated Eclipse Testing"/> |
| 20 | <echo |
david_williams | 1543a9b | 2009-11-24 01:43:55 +0000 | [diff] [blame] | 21 | level="info" |
david_williams | 904dc3f | 2009-11-24 13:41:49 +0000 | [diff] [blame] | 22 | message="ant file basedir: ${basedir}"/> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 23 | <echo |
david_williams | 1543a9b | 2009-11-24 01:43:55 +0000 | [diff] [blame] | 24 | level="info" |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 25 | message="testRoot: ${testRoot}"/> |
| 26 | <fail |
| 27 | message="testRoot must be set" |
| 28 | unless="testRoot"/> |
| 29 | |
| 30 | <!--properties file containing the build information--> |
| 31 | <property |
| 32 | file="${buildDirectory}/label.properties"/> |
david_williams | db9eed9 | 2009-11-18 20:03:49 +0000 | [diff] [blame] | 33 | <!-- required to get proper value of dropinsFolder --> |
| 34 | <property |
| 35 | name="keyCfgFile" |
| 36 | value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/> |
| 37 | <echo |
david_williams | 1543a9b | 2009-11-24 01:43:55 +0000 | [diff] [blame] | 38 | level="info" |
david_williams | db9eed9 | 2009-11-18 20:03:49 +0000 | [diff] [blame] | 39 | message="keyCfgFile: ${keyCfgFile}"/> |
| 40 | <property |
| 41 | file="${keyCfgFile}"/> |
david_williams | c9b2f50 | 2009-11-24 08:02:51 +0000 | [diff] [blame] | 42 | |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 43 | <!-- |
| 44 | name that can be added to report name to identify which platform |
| 45 | tests results come from |
| 46 | --> |
| 47 | <property |
| 48 | name="platform" |
| 49 | value=""/> |
david_williams | b4d960f | 2010-04-14 13:58:23 +0000 | [diff] [blame] | 50 | <!-- |
| 51 | TODO: The framework apps might need this. But we should |
| 52 | elmimnate if posslbe. |
| 53 | --> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 54 | <property |
| 55 | name="eclipse-home" |
david_williams | 81ed2e8 | 2010-08-04 22:58:55 +0000 | [diff] [blame] | 56 | value="${testRoot}/eclipse"/> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 57 | <!-- |
| 58 | The directory that will contain the xml and html results from |
| 59 | the tests that are run |
| 60 | --> |
| 61 | <property |
| 62 | name="results" |
| 63 | value="${testRoot}/results"/> |
david_williams | db9eed9 | 2009-11-18 20:03:49 +0000 | [diff] [blame] | 64 | <property |
| 65 | name="library-file" |
| 66 | value="${testRoot}/wtp-junit-tests.xml"/> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 67 | <target |
| 68 | name="init"> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 69 | </target> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 70 | <target |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 71 | name="all" |
david_williams | 81ed2e8 | 2010-08-04 22:58:55 +0000 | [diff] [blame] | 72 | depends="init,runOneTestBundle" |
| 73 | unless="testBundle"> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 74 | <echo |
| 75 | level="info" |
| 76 | message="Starting Unit Tests"/> |
david_williams | db9eed9 | 2009-11-18 20:03:49 +0000 | [diff] [blame] | 77 | <!-- |
| 78 | unlike other ant tasks, subant defaults to false for |
| 79 | inheritall! |
| 80 | --> |
david_williams | d428a97 | 2009-11-15 00:41:45 +0000 | [diff] [blame] | 81 | <subant |
david_williams | db9eed9 | 2009-11-18 20:03:49 +0000 | [diff] [blame] | 82 | target="" |
| 83 | inheritall="true"> |
david_williams | 81ed2e8 | 2010-08-04 22:58:55 +0000 | [diff] [blame] | 84 | <!-- note that we specify "high" directory to get tests installed |
| 85 | in any location --> |
david_williams | d428a97 | 2009-11-15 00:41:45 +0000 | [diff] [blame] | 86 | <fileset |
david_williams | 81ed2e8 | 2010-08-04 22:58:55 +0000 | [diff] [blame] | 87 | dir="${testRoot}"> |
| 88 | <!-- but we must be sure to exclude _this_ test.xml file |
| 89 | we are running --> |
| 90 | <exclude |
| 91 | name="test.xml"/> |
david_williams | d428a97 | 2009-11-15 00:41:45 +0000 | [diff] [blame] | 92 | <exclude |
| 93 | name="**/*performance*/test.xml"/> |
| 94 | <include |
| 95 | name="**/test.xml"/> |
| 96 | </fileset> |
| 97 | </subant> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 98 | <echo |
| 99 | level="info" |
| 100 | message="Ended Unit Tests"/> |
david_williams | d50d36c | 2009-11-11 07:03:50 +0000 | [diff] [blame] | 101 | <antcall |
david_williams | d428a97 | 2009-11-15 00:41:45 +0000 | [diff] [blame] | 102 | target="genHtml"/> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 103 | </target> |
david_williams | 81ed2e8 | 2010-08-04 22:58:55 +0000 | [diff] [blame] | 104 | <!-- |
| 105 | by making 'all' the default, and "runOneTestBundle" as its |
| 106 | 'depends' we can effectively control which is ran based on |
| 107 | whether or not 'testBundle' has been defined by caller. If so, |
| 108 | only that one is ran, otherwise, all of them are. Note, in many |
| 109 | cases a collection of tests could be ran, by specifying a |
| 110 | partial bundle name. for example, specifying |
| 111 | "org.eclipse.jst.jsp" would execute the 3 JSP tests: |
| 112 | org.eclipse.jst.jsp.core.tests, |
| 113 | org.eclipse.jst.jsp.tests.encoding, |
| 114 | org.eclipse.jst.jsp.ui.tests. |
| 115 | --> |
| 116 | <target |
| 117 | name="runOneTestBundle" |
| 118 | depends="init" |
| 119 | if="testBundle"> |
| 120 | <echo |
| 121 | level="info" |
| 122 | message="Starting Unit Tests for one test bundle"/> |
| 123 | <!-- |
| 124 | unlike other ant tasks, subant defaults to false for |
| 125 | inheritall! |
| 126 | --> |
| 127 | <subant |
| 128 | target="" |
| 129 | inheritall="true"> |
| 130 | <fileset |
| 131 | dir="${eclipse-home}/plugins/"> |
| 132 | <exclude |
| 133 | name="**/*performance*/test.xml"/> |
| 134 | <include |
| 135 | name="**/${testBundle}*/test.xml"/> |
| 136 | </fileset> |
| 137 | </subant> |
| 138 | <echo |
| 139 | level="info" |
| 140 | message="Finished Unit Tests for one test bundle"/> |
| 141 | <antcall |
| 142 | target="genHtml"/> |
| 143 | </target> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 144 | <target |
| 145 | name="genHtml" |
| 146 | description="Generates HTML results with provided JUNIT.XSL provided" |
| 147 | unless="genHtml.disable"> |
| 148 | <xslt |
| 149 | style="JUNIT.XSL" |
| 150 | basedir="${results}/xml" |
| 151 | destdir="${results}/html"/> |
| 152 | </target> |
david_williams | 0ecd8ec | 2009-11-09 04:16:21 +0000 | [diff] [blame] | 153 | </project> |