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 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!-- ============================================================================== -->
  2. <!-- This assumes a complete pre-built eclipse workspace -->
  3. <!-- ============================================================================== -->
  4. <project name="junitModules" default="test-all" basedir=".">
  5. <property name="project.name" value="junitModules"/>
  6. <target name="init">
  7. <property name="haltOnTestFailure" value="false"/>
  8. <property name="modules.dir"
  9. location="${basedir}/.."/>
  10. <property name="tests.module.dir"
  11. location="${modules.dir}/tests"/>
  12. <property name="aspectj.modules.lib.dir"
  13. location="${modules.dir}/lib"/>
  14. <property name="junitModules.output.dir"
  15. location="${tests.module.dir}/bin/junitXmlOutput" />
  16. <mkdir dir="${junitModules.output.dir}"/>
  17. </target>
  18. <target name="clean" depends="init">
  19. <delete dir="${junitModules.output.dir}"/>
  20. </target>
  21. <target name="jdepend" depends="init"
  22. description="run jdepend">
  23. <jdepend format="xml">
  24. <sourcespath>
  25. <pathelement location="${tests.module.dir}/../testing/src" />
  26. </sourcespath>
  27. <classpath>
  28. <pathelement location="${tests.module.dir}/../bin" />
  29. </classpath>
  30. </jdepend>
  31. </target>
  32. <target name="redirect-test-all" depends="init"
  33. description="run from another Ant process to redirect output">
  34. <antcall target="clean"/>
  35. <mkdir dir="${junitModules.output.dir}"/>
  36. <ant dir="${basedir}"
  37. antfile="junitModules.xml"
  38. target="run-test-all"
  39. inheritAll="false"
  40. output="${junitModules.output.dir}/output.txt"/>
  41. <echo message="View log in ${junitModules.output.dir}/output.txt"/>
  42. <property name="fileUrl"
  43. location="${junitModules.output.dir}/html/index.html"/>
  44. <echo message="View results in file:${fileUrl}"/>
  45. </target>
  46. <target name="test-all" depends="init"
  47. description="run all module tests (except IDE integrations)">
  48. <!-- not running bridgeImpl, compiler, netbeans, jbuilder tests -->
  49. <mkdir dir="${junitModules.output.dir}"/>
  50. <delete dir="${junitModules.output.dir}"/>
  51. <mkdir dir="${junitModules.output.dir}"/>
  52. <antcall target="run-module-junit-tests">
  53. <param name="moduleName" value="ajbrowser"/>
  54. </antcall>
  55. <antcall target="run-module-junit-tests">
  56. <param name="moduleName" value="ajde"/>
  57. </antcall>
  58. <antcall target="run-module-junit-tests">
  59. <param name="moduleName" value="asm"/>
  60. </antcall>
  61. <antcall target="run-module-junit-tests">
  62. <param name="moduleName" value="weaver"/>
  63. </antcall>
  64. <antcall target="run-module-junit-tests">
  65. <param name="moduleName" value="bridge"/>
  66. </antcall>
  67. <antcall target="run-module-junit-tests">
  68. <param name="moduleName" value="build"/>
  69. </antcall>
  70. <antcall target="run-module-junit-tests">
  71. <param name="moduleName" value="org.aspectj.ajdt.core"/>
  72. </antcall>
  73. <!-- no JUnit testsrc in org.eclipse.jdt.core -->
  74. <antcall target="run-module-junit-tests">
  75. <param name="moduleName" value="testing"/>
  76. </antcall>
  77. <antcall target="run-module-junit-tests">
  78. <param name="moduleName" value="runtime"/>
  79. </antcall>
  80. <antcall target="run-module-junit-tests">
  81. <param name="moduleName" value="taskdefs"/>
  82. </antcall>
  83. <antcall target="run-module-junit-tests">
  84. <param name="moduleName" value="testing"/>
  85. </antcall>
  86. <antcall target="run-module-junit-tests">
  87. <param name="moduleName" value="testing-client"/>
  88. </antcall>
  89. <antcall target="run-module-junit-tests">
  90. <param name="moduleName" value="testing-drivers"/>
  91. </antcall>
  92. <antcall target="run-module-junit-tests">
  93. <param name="moduleName" value="testing-util"/>
  94. </antcall>
  95. <antcall target="run-module-junit-tests">
  96. <param name="moduleName" value="util"/>
  97. </antcall>
  98. <antcall target="report-tests"/>
  99. </target>
  100. <target name="init-taskdefs" depends="init"
  101. description="define junit taskdefs" >
  102. <property name="aj.taskdef.package"
  103. value="org.aspectj.internal.tools.ant.taskdefs"/>
  104. <taskdef name="junit"
  105. classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
  106. <classpath>
  107. <pathelement location="${aspectj.modules.lib.dir}/ant/xlib/optional.jar" />
  108. <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar" />
  109. </classpath>
  110. </taskdef>
  111. <taskdef name="junitreport"
  112. classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
  113. <classpath>
  114. <pathelement location="${aspectj.modules.lib.dir}/ant/xlib/optional.jar" />
  115. <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar" />
  116. </classpath>
  117. </taskdef>
  118. </target>
  119. <target name="run-module-junit-tests" depends="init-taskdefs"
  120. description="run all junit tests for a module">
  121. <mkdir dir="${junitModules.output.dir}/${moduleName}"/>
  122. <!-- fork to load classes, include AntRuntime to get taskdef classes junit.jar -->
  123. <echo message="Starting ${moduleName} tests..."/>
  124. <junit fork="on" includeAntRuntime="on" dir="${modules.dir}/${moduleName}"
  125. printsummary="yes" haltonfailure="${haltOnTestFailure}" >
  126. <classpath>
  127. <pathelement location="${modules.dir}/ajde/bin" />
  128. <pathelement location="${modules.dir}/ajbrowser/bin" />
  129. <pathelement location="${modules.dir}/asm/bin" />
  130. <pathelement location="${modules.dir}/bridge/bin" />
  131. <pathelement location="${modules.dir}/build/bin" />
  132. <pathelement location="${modules.dir}/org.aspectj.ajdt.core/bin" />
  133. <pathelement location="${modules.dir}/org.eclipse.jdt.core/bin" />
  134. <pathelement location="${modules.dir}/runtime/bin" />
  135. <pathelement location="${modules.dir}/taskdefs/bin" />
  136. <pathelement location="${modules.dir}/testing/bin" />
  137. <pathelement location="${modules.dir}/testing-client/bin" />
  138. <pathelement location="${modules.dir}/testing-drivers/bin" />
  139. <pathelement location="${modules.dir}/testing-util/bin" />
  140. <pathelement location="${modules.dir}/util/bin" />
  141. <pathelement location="${modules.dir}/weaver/bin" />
  142. <pathelement location="${aspectj.modules.lib.dir}/eclipse2.0/jdtDepends.jar" />
  143. <pathelement location="${aspectj.modules.lib.dir}/bcel/bcel.jar" />
  144. <pathelement location="${aspectj.modules.lib.dir}/jdiff/jdiff.jar" />
  145. <pathelement location="${aspectj.modules.lib.dir}/commons/commons.jar" />
  146. <pathelement location="${aspectj.modules.lib.dir}/ant/lib/ant.jar" />
  147. <pathelement location="${aspectj.modules.lib.dir}/ant/lib/xml-apis.jar" />
  148. <pathelement location="${aspectj.modules.lib.dir}/ant/lib/xercesImpl.jar" />
  149. <pathelement location="${aspectj.modules.lib.dir}/test/aspectjrt.jar" />
  150. </classpath>
  151. <!-- AMC added this next line, needed when testing release builds,
  152. (those whose version is something other than DEVELOPMENT). The NullIdeAdapter
  153. used for various Ajde tests picks up this property and adds it to the project
  154. classpath, which allows the Ajde version tests to complete.
  155. Having built a release version, use e.g.
  156. ant -Daspectjrt.path=../aj-build/dist/lib/aspectjrt.jar
  157. -->
  158. <jvmarg value="-Daspectjrt.path=${aspectjrt.path}" />
  159. <formatter type="xml"/>
  160. <batchtest todir="${junitModules.output.dir}/${moduleName}">
  161. <formatter type="xml"/>
  162. <fileset dir="${modules.dir}/${moduleName}/testsrc">
  163. <include name="*ModuleTests.java" />
  164. </fileset>
  165. </batchtest>
  166. </junit>
  167. </target>
  168. <target name="report-tests" depends="init-taskdefs">
  169. <mkdir dir="${junitModules.output.dir}/html"/>
  170. <junitreport todir="${junitModules.output.dir}/html"
  171. tofile="results.html">
  172. <fileset dir="${junitModules.output.dir}/">
  173. <include name="**/TEST-*.xml"/>
  174. </fileset>
  175. <report format="frames"
  176. todir="${junitModules.output.dir}/html"/>
  177. </junitreport>
  178. <property name="fileUrl"
  179. location="${junitModules.output.dir}/html/index.html"/>
  180. <echo message="View results in file:${fileUrl}"/>
  181. </target>
  182. </project>