You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

junitModules.xml 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!-- -*- Mode: SGML; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -->
  2. <!-- -->
  3. <!-- This file is part of the compiler and core tools for the AspectJ(tm) -->
  4. <!-- programming language; see http://aspectj.org -->
  5. <!-- -->
  6. <!-- The contents of this file are subject to the Mozilla Public License -->
  7. <!-- Version 1.1 (the "License"); you may not use this file except in -->
  8. <!-- compliance with the License. You may obtain a copy of the License at -->
  9. <!-- either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/. -->
  10. <!-- -->
  11. <!-- Software distributed under the License is distributed on an "AS IS" basis, -->
  12. <!-- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -->
  13. <!-- for the specific language governing rights and limitations under the -->
  14. <!-- License. -->
  15. <!-- -->
  16. <!-- The Original Code is AspectJ. -->
  17. <!-- -->
  18. <!-- The Initial Developer of the Original Code is Xerox Corporation. Portions -->
  19. <!-- created by Xerox Corporation are Copyright (C) 2002 Xerox Corporation. -->
  20. <!-- All Rights Reserved. -->
  21. <!-- ============================================================================== -->
  22. <!-- This assumes a complete pre-built eclipse workspace -->
  23. <!-- ============================================================================== -->
  24. <project name="junitModules" default="test-all" basedir=".">
  25. <property name="project.name" value="junitModules"/>
  26. <target name="init">
  27. <property name="haltOnTestFailure" value="false"/>
  28. <property name="modules.dir"
  29. location="${basedir}/.."/>
  30. <property name="tests.module.dir"
  31. location="${modules.dir}/tests"/>
  32. <property name="aspectj.modules.lib.dir"
  33. location="${modules.dir}/lib"/>
  34. <property name="junitModules.output.dir"
  35. location="${tests.module.dir}/bin/junitXmlOutput" />
  36. <mkdir dir="${junitModules.output.dir}"/>
  37. </target>
  38. <target name="clean" depends="init">
  39. <delete dir="${junitModules.output.dir}"/>
  40. </target>
  41. <target name="jdepend" depends="init"
  42. description="run jdepend">
  43. <jdepend format="xml">
  44. <sourcespath>
  45. <pathelement location="${tests.module.dir}/../testing/src" />
  46. </sourcespath>
  47. <classpath>
  48. <pathelement location="${tests.module.dir}/../bin" />
  49. </classpath>
  50. </jdepend>
  51. </target>
  52. <target name="redirect-test-all" depends="init"
  53. description="run from another Ant process to redirect output">
  54. <antcall target="clean"/>
  55. <mkdir dir="${junitModules.output.dir}"/>
  56. <ant dir="${basedir}"
  57. antfile="junitModules.xml"
  58. target="run-test-all"
  59. inheritAll="false"
  60. output="${junitModules.output.dir}/output.txt"/>
  61. <echo message="View log in ${junitModules.output.dir}/output.txt"/>
  62. <property name="fileUrl"
  63. location="${junitModules.output.dir}/html/index.html"/>
  64. <echo message="View results in file:${fileUrl}"/>
  65. </target>
  66. <target name="test-all" depends="init"
  67. description="run all module tests (except IDE integrations)">
  68. <!-- not running bridgeImpl, compiler, netbeans, jbuilder tests -->
  69. <mkdir dir="${junitModules.output.dir}"/>
  70. <delete dir="${junitModules.output.dir}"/>
  71. <mkdir dir="${junitModules.output.dir}"/>
  72. <antcall target="run-module-junit-tests">
  73. <param name="moduleName" value="ajbrowser"/>
  74. </antcall>
  75. <antcall target="run-module-junit-tests">
  76. <param name="moduleName" value="ajde"/>
  77. </antcall>
  78. <antcall target="run-module-junit-tests">
  79. <param name="moduleName" value="asm"/>
  80. </antcall>
  81. <antcall target="run-module-junit-tests">
  82. <param name="moduleName" value="weaver"/>
  83. </antcall>
  84. <antcall target="run-module-junit-tests">
  85. <param name="moduleName" value="bridge"/>
  86. </antcall>
  87. <antcall target="run-module-junit-tests">
  88. <param name="moduleName" value="build"/>
  89. </antcall>
  90. <antcall target="run-module-junit-tests">
  91. <param name="moduleName" value="org.aspectj.ajdt.core"/>
  92. </antcall>
  93. <!-- no JUnit testsrc in org.eclipse.jdt.core -->
  94. <antcall target="run-module-junit-tests">
  95. <param name="moduleName" value="testing"/>
  96. </antcall>
  97. <antcall target="run-module-junit-tests">
  98. <param name="moduleName" value="runtime"/>
  99. </antcall>
  100. <antcall target="run-module-junit-tests">
  101. <param name="moduleName" value="taskdefs"/>
  102. </antcall>
  103. <antcall target="run-module-junit-tests">
  104. <param name="moduleName" value="testing"/>
  105. </antcall>
  106. <antcall target="run-module-junit-tests">
  107. <param name="moduleName" value="testing-client"/>
  108. </antcall>
  109. <antcall target="run-module-junit-tests">
  110. <param name="moduleName" value="testing-drivers"/>
  111. </antcall>
  112. <antcall target="run-module-junit-tests">
  113. <param name="moduleName" value="testing-util"/>
  114. </antcall>
  115. <antcall target="run-module-junit-tests">
  116. <param name="moduleName" value="util"/>
  117. </antcall>
  118. <antcall target="report-tests"/>
  119. </target>
  120. <target name="init-taskdefs" depends="init"
  121. description="define junit taskdefs" >
  122. <property name="aj.taskdef.package"
  123. value="org.aspectj.internal.tools.ant.taskdefs"/>
  124. <taskdef name="junit"
  125. classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
  126. <classpath>
  127. <pathelement location="${aspectj.modules.lib.dir}/ant/xlib/optional.jar" />
  128. <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar" />
  129. </classpath>
  130. </taskdef>
  131. <taskdef name="junitreport"
  132. classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
  133. <classpath>
  134. <pathelement location="${aspectj.modules.lib.dir}/ant/xlib/optional.jar" />
  135. <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar" />
  136. </classpath>
  137. </taskdef>
  138. </target>
  139. <target name="run-module-junit-tests" depends="init-taskdefs"
  140. description="run all junit tests for a module">
  141. <mkdir dir="${junitModules.output.dir}/${moduleName}"/>
  142. <!-- fork to load classes, include AntRuntime to get taskdef classes junit.jar -->
  143. <echo message="Starting ${moduleName} tests..."/>
  144. <junit fork="on" includeAntRuntime="on" dir="${modules.dir}/${moduleName}"
  145. printsummary="yes" haltonfailure="${haltOnTestFailure}" >
  146. <classpath>
  147. <pathelement location="${modules.dir}/ajde/bin" />
  148. <pathelement location="${modules.dir}/ajbrowser/bin" />
  149. <pathelement location="${modules.dir}/asm/bin" />
  150. <pathelement location="${modules.dir}/bridge/bin" />
  151. <pathelement location="${modules.dir}/build/bin" />
  152. <pathelement location="${modules.dir}/org.aspectj.ajdt.core/bin" />
  153. <pathelement location="${modules.dir}/org.eclipse.jdt.core/bin" />
  154. <pathelement location="${modules.dir}/runtime/bin" />
  155. <pathelement location="${modules.dir}/taskdefs/bin" />
  156. <pathelement location="${modules.dir}/testing/bin" />
  157. <pathelement location="${modules.dir}/testing-client/bin" />
  158. <pathelement location="${modules.dir}/testing-drivers/bin" />
  159. <pathelement location="${modules.dir}/testing-util/bin" />
  160. <pathelement location="${modules.dir}/util/bin" />
  161. <pathelement location="${modules.dir}/weaver/bin" />
  162. <pathelement location="${aspectj.modules.lib.dir}/eclipse2.0/jdtDepends.jar" />
  163. <pathelement location="${aspectj.modules.lib.dir}/bcel/bcel.jar" />
  164. <pathelement location="${aspectj.modules.lib.dir}/jdiff/jdiff.jar" />
  165. <pathelement location="${aspectj.modules.lib.dir}/commons/commons.jar" />
  166. <pathelement location="${aspectj.modules.lib.dir}/ant/lib/ant.jar" />
  167. <pathelement location="${aspectj.modules.lib.dir}/ant/lib/xml-apis.jar" />
  168. <pathelement location="${aspectj.modules.lib.dir}/ant/lib/xercesImpl.jar" />
  169. <pathelement location="${aspectj.modules.lib.dir}/test/aspectjrt.jar" />
  170. </classpath>
  171. <formatter type="xml"/>
  172. <batchtest todir="${junitModules.output.dir}/${moduleName}">
  173. <formatter type="xml"/>
  174. <fileset dir="${modules.dir}/${moduleName}/testsrc">
  175. <include name="*ModuleTests.java" />
  176. </fileset>
  177. </batchtest>
  178. </junit>
  179. </target>
  180. <target name="report-tests" depends="init-taskdefs">
  181. <mkdir dir="${junitModules.output.dir}/html"/>
  182. <junitreport todir="${junitModules.output.dir}/html"
  183. tofile="results.html">
  184. <fileset dir="${junitModules.output.dir}/">
  185. <include name="**/TEST-*.xml"/>
  186. </fileset>
  187. <report format="frames"
  188. todir="${junitModules.output.dir}/html"/>
  189. </junitreport>
  190. <property name="fileUrl"
  191. location="${junitModules.output.dir}/html/index.html"/>
  192. <echo message="View results in file:${fileUrl}"/>
  193. </target>
  194. </project>