123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
-
- <!-- ============================================================================== -->
- <!-- This assumes a complete pre-built eclipse workspace -->
- <!-- ============================================================================== -->
-
- <project name="junitModules" default="test-all" basedir=".">
- <property name="project.name" value="junitModules"/>
-
- <target name="init">
- <property name="haltOnTestFailure" value="false"/>
- <property name="modules.dir"
- location="${basedir}/.."/>
- <property name="tests.module.dir"
- location="${modules.dir}/tests"/>
- <property name="aspectj.modules.lib.dir"
- location="${modules.dir}/lib"/>
- <property name="junitModules.output.dir"
- location="${tests.module.dir}/bin/junitXmlOutput" />
- <mkdir dir="${junitModules.output.dir}"/>
- </target>
-
- <target name="clean" depends="init">
- <delete dir="${junitModules.output.dir}"/>
- </target>
-
-
- <target name="jdepend" depends="init"
- description="run jdepend">
- <jdepend format="xml">
- <sourcespath>
- <pathelement location="${tests.module.dir}/../testing/src" />
- </sourcespath>
- <classpath>
- <pathelement location="${tests.module.dir}/../bin" />
- </classpath>
- </jdepend>
- </target>
-
- <target name="redirect-test-all" depends="init"
- description="run from another Ant process to redirect output">
- <antcall target="clean"/>
- <mkdir dir="${junitModules.output.dir}"/>
- <ant dir="${basedir}"
- antfile="junitModules.xml"
- target="run-test-all"
- inheritAll="false"
- output="${junitModules.output.dir}/output.txt"/>
- <echo message="View log in ${junitModules.output.dir}/output.txt"/>
- <property name="fileUrl"
- location="${junitModules.output.dir}/html/index.html"/>
- <echo message="View results in file:${fileUrl}"/>
- </target>
-
- <target name="test-all" depends="init"
- description="run all module tests (except IDE integrations)">
- <!-- not running bridgeImpl, compiler, netbeans, jbuilder tests -->
-
- <mkdir dir="${junitModules.output.dir}"/>
- <delete dir="${junitModules.output.dir}"/>
- <mkdir dir="${junitModules.output.dir}"/>
-
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="ajbrowser"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="ajde"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="asm"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="weaver"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="bridge"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="build"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="org.aspectj.ajdt.core"/>
- </antcall>
- <!-- no JUnit testsrc in org.eclipse.jdt.core -->
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="testing"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="runtime"/>
- </antcall>
-
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="taskdefs"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="testing"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="testing-client"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="testing-drivers"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="testing-util"/>
- </antcall>
- <antcall target="run-module-junit-tests">
- <param name="moduleName" value="util"/>
- </antcall>
-
- <antcall target="report-tests"/>
-
- </target>
-
- <target name="init-taskdefs" depends="init"
- description="define junit taskdefs" >
- <property name="aj.taskdef.package"
- value="org.aspectj.internal.tools.ant.taskdefs"/>
-
- <taskdef name="junit"
- classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
- <classpath>
- <pathelement location="${aspectj.modules.lib.dir}/ant/xlib/optional.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar" />
- </classpath>
- </taskdef>
- <taskdef name="junitreport"
- classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
- <classpath>
- <pathelement location="${aspectj.modules.lib.dir}/ant/xlib/optional.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar" />
- </classpath>
- </taskdef>
-
- </target>
-
- <target name="run-module-junit-tests" depends="init-taskdefs"
- description="run all junit tests for a module">
- <mkdir dir="${junitModules.output.dir}/${moduleName}"/>
- <!-- fork to load classes, include AntRuntime to get taskdef classes junit.jar -->
- <echo message="Starting ${moduleName} tests..."/>
- <junit fork="on" includeAntRuntime="on" dir="${modules.dir}/${moduleName}"
- printsummary="yes" haltonfailure="${haltOnTestFailure}" >
- <classpath>
- <pathelement location="${modules.dir}/ajde/bin" />
- <pathelement location="${modules.dir}/ajbrowser/bin" />
- <pathelement location="${modules.dir}/asm/bin" />
- <pathelement location="${modules.dir}/bridge/bin" />
- <pathelement location="${modules.dir}/build/bin" />
- <pathelement location="${modules.dir}/org.aspectj.ajdt.core/bin" />
- <pathelement location="${modules.dir}/org.eclipse.jdt.core/bin" />
- <pathelement location="${modules.dir}/runtime/bin" />
- <pathelement location="${modules.dir}/taskdefs/bin" />
- <pathelement location="${modules.dir}/testing/bin" />
- <pathelement location="${modules.dir}/testing-client/bin" />
- <pathelement location="${modules.dir}/testing-drivers/bin" />
- <pathelement location="${modules.dir}/testing-util/bin" />
- <pathelement location="${modules.dir}/util/bin" />
- <pathelement location="${modules.dir}/weaver/bin" />
- <pathelement location="${aspectj.modules.lib.dir}/eclipse2.0/jdtDepends.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/bcel/bcel.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/jdiff/jdiff.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/commons/commons.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/ant/lib/ant.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/ant/lib/xml-apis.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/ant/lib/xercesImpl.jar" />
- <pathelement location="${aspectj.modules.lib.dir}/test/aspectjrt.jar" />
- </classpath>
-
- <!-- AMC added this next line, needed when testing release builds,
- (those whose version is something other than DEVELOPMENT). The NullIdeAdapter
- used for various Ajde tests picks up this property and adds it to the project
- classpath, which allows the Ajde version tests to complete.
- Having built a release version, use e.g.
- ant -Daspectjrt.path=../aj-build/dist/lib/aspectjrt.jar
- -->
- <jvmarg value="-Daspectjrt.path=${aspectjrt.path}" />
-
- <formatter type="xml"/>
-
- <batchtest todir="${junitModules.output.dir}/${moduleName}">
- <formatter type="xml"/>
- <fileset dir="${modules.dir}/${moduleName}/testsrc">
- <include name="*ModuleTests.java" />
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="report-tests" depends="init-taskdefs">
- <mkdir dir="${junitModules.output.dir}/html"/>
- <junitreport todir="${junitModules.output.dir}/html"
- tofile="results.html">
- <fileset dir="${junitModules.output.dir}/">
- <include name="**/TEST-*.xml"/>
- </fileset>
- <report format="frames"
- todir="${junitModules.output.dir}/html"/>
- </junitreport>
- <property name="fileUrl"
- location="${junitModules.output.dir}/html/index.html"/>
- <echo message="View results in file:${fileUrl}"/>
- </target>
- </project>
|