Commit 6a02bdea authored by Vít Kabele's avatar Vít Kabele

Disl unit tests are now executed within the subproject.

parent f9715d73
Pipeline #3400 passed with stages
in 3 minutes and 13 seconds
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<classpathentry kind="src" path="disl/src/src-weaver-pe"/> <classpathentry kind="src" path="disl/src/src-weaver-pe"/>
<classpathentry kind="src" path="disl/src/src-annotation"/> <classpathentry kind="src" path="disl/src/src-annotation"/>
<classpathentry kind="src" path="disl/src/src-context"/> <classpathentry kind="src" path="disl/src/src-context"/>
<classpathentry kind="src" path="disl/src-test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="output/lib/disl-bypass.jar"/> <classpathentry kind="lib" path="output/lib/disl-bypass.jar"/>
<classpathentry kind="lib" path="lib/disl/log4j.jar" sourcepath="lib/devel/log4j-source.jar"/> <classpathentry kind="lib" path="lib/disl/log4j.jar" sourcepath="lib/devel/log4j-source.jar"/>
......
...@@ -786,8 +786,12 @@ ...@@ -786,8 +786,12 @@
</sequential> </sequential>
</macrodef> </macrodef>
<!-- Run nested instrumentation library tests -->
<target name="disl-test">
<ant antfile="${src.disl.prefix}/build.xml" target="test" usenativebasedir="true"/>
</target>
<target name="test" depends="build,build-test" description="Runs all tests or a selected (-Dtest.name=...) test suite."> <target name="test" depends="build,build-test,disl-test" description="Runs all tests or a selected (-Dtest.name=...) test suite.">
<!-- <!--
If test.name is set to a name of a test suite, only include the test suite If test.name is set to a name of a test suite, only include the test suite
in the batch of tests to be run, otherwise include all tests and suites. in the batch of tests to be run, otherwise include all tests and suites.
......
...@@ -18,3 +18,6 @@ src.disl.staticcontext=src-staticcontext ...@@ -18,3 +18,6 @@ src.disl.staticcontext=src-staticcontext
src.disl.util=src-util src.disl.util=src-util
src.disl.weaver-pe=src-weaver-pe src.disl.weaver-pe=src-weaver-pe
src.disl.weaver=src-weaver src.disl.weaver=src-weaver
src.disl.test=src-test
build.disl.test=${build.dir}/test
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
<pathelement location="../${build.util}"/> <pathelement location="../${build.util}"/>
</path> </path>
<path id="junit.classpath">
<fileset dir="../${lib.test.dir}" includes="*.jar"/>
</path>
<path id="disl.bypass.classpath"> <path id="disl.bypass.classpath">
<pathelement location="../${build.disl.bypass}/dynamic"/> <pathelement location="../${build.disl.bypass}/dynamic"/>
</path> </path>
...@@ -26,6 +30,7 @@ ...@@ -26,6 +30,7 @@
--> -->
<target name="init"> <target name="init">
<mkdir dir="${build.disl}" /> <mkdir dir="${build.disl}" />
<mkdir dir="${build.disl.test}" />
</target> </target>
<!-- <!--
...@@ -41,7 +46,7 @@ ...@@ -41,7 +46,7 @@
<!-- DiSL --> <!-- DiSL -->
<target name="compile" depends="compile-util,compile-disl-bypass, init"> <target name="compile" depends="compile-util,compile-disl-bypass, init">
<javac destdir="${build.disl}" debug="true"> <javac destdir="${build.disl}" debug="true" includeantruntime="false">
<src path="src/${src.disl.annotation}"/> <src path="src/${src.disl.annotation}"/>
<src path="src/${src.disl.classparser}"/> <src path="src/${src.disl.classparser}"/>
<src path="src/${src.disl.coderep}"/> <src path="src/${src.disl.coderep}"/>
...@@ -69,6 +74,43 @@ ...@@ -69,6 +74,43 @@
</javac> </javac>
</target> </target>
<target name="compile-tests" depends="compile">
<javac destdir="${build.disl.test}" debug="true" srcdir="${src.disl.test}" includeantruntime="false">
<classpath>
<path refid="disl.bypass.classpath"/>
<path refid="util.classpath"/>
<path refid="asm.classpath"/>
<path refid="junit.classpath"/>
<path path="${build.disl}"/>
</classpath>
</javac>
</target>
<target name="test" depends="compile-tests" description="Run all unit tests">
<echo>Running DiSL intrumentation library tests...</echo>
<junit haltonfailure="yes" haltonerror="yes" failureproperty="junit.failure">
<formatter type="brief" usefile="false"/>
<classpath>
<path refid="asm.classpath"/>
<path refid="junit.classpath"/>
<path path="${build.disl.test}"/>
<path path="../${build.util}"/>
<path path="${build.disl}"/>
</classpath>
<batchtest fork="yes">
<fileset dir="${src.disl.test}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!--
Clean the build directory
-->
<target name="clean"> <target name="clean">
<delete dir="${out.dir}" /> <delete dir="${out.dir}" />
</target> </target>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment