java/build.common.xml
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 20 Mar 2016 13:19:32 +0000
changeset 3541 69805e2d87e6
parent 3387 79624c24b4d8
child 3542 f3a6a43a53a1
permissions -rw-r--r--
Build files: added ant target `test` to build and run tests. Use `ant test` in java directory to run tests under real JVM. By default test sources should be in directory `java/src-tests` and are compiled to `java/bin-tests`. If `java/src-tests` does not exist, `ant test` is noop. Indeed, individual packages may add more test targets by extending targets `test.compile.pre`/`test.compile.post` and `test.run.pre` and \`test.run.post`. When one or more tests fail, property `test.faulure` should be set to indicate failure.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
<project xmlns:ivy="antlib:org.apache.ivy.ant">
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
    <property name="ivy.jar" value="${TOP}/libjava/java/ivy-2.3.0.jar"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
    <property name="build.src.dir" value="src"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
    <property name="build.bin.dir" value="bin"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
    <property name="build.libs.dir" value="libs"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
    <property name="build.libs-src.dir" value="libs-src"/>
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
     9
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    10
    <property name="build.src-tests.dir" value="src-tests"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    11
    <property name="build.bin-tests.dir" value="bin-tests"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    12
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    13
    <property name="test.report"     value="test-results.xml"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    14
    <property name="test.report.dir" value="test-results"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    15
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
    <property name="ivy.dep.file" value="ivy.xml"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
    <available file="${ivy.dep.file}" property="ivy.dep.file.present"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
    <available file="${build.src.dir}" property="build.src.dir.present"/>
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    20
    <available file="${build.src-tests.dir}" property="build.src-tests.dir.present"/>
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
    <path id="build.classpath.prereqs">
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    </path>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
    <path id="build.classpath">
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    26
	   <path refid="build.classpath.prereqs"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    27
	   <pathelement path="${build.libs.dir}"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    28
	   <fileset dir="${build.libs.dir}">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    29
	       <include name="*.jar"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    30
	   </fileset>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    31
    </path>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    32
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    33
    <path id="test.classpath">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    34
        <path refid="build.classpath"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    35
        <pathelement path="${build.bin.dir}"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    36
        <pathelement path="${build.bin-tests.dir}"/>
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
    </path>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
    <target name="build" depends="compile"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
    <extension-point name="compile.pre"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
    <extension-point name="compile.post"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
    <target name="compile.main" if="${build.src.dir.present}">
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    45
    	<mkdir dir="${build.bin.dir}"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    46
    	<javac srcdir="${build.src.dir}"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    47
    	       destdir="${build.bin.dir}"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    48
    	       classpathref="build.classpath"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    49
    	       debug="true"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    50
    	       debuglevel="lines,vars,source"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    51
    	       includeantruntime="false"/>
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    </target>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
    <target name="compile" depends="prereqs, compile.pre, compile.main, compile.post"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
    <target name="dependencies" depends="prereqs"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
    <extension-point name="prereqs.pre"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    <extension-point name="prereqs.post"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
    <extension-point  name="prereqs.main"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
    <target name="prereqs" depends="libs, prereqs.pre, prereqs.main, prereqs.post"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
    <extension-point name="libs.pre"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
    <extension-point name="libs.post"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
    <target name="libs.main">
3387
79624c24b4d8 buildfiles: oops, build Java classes with debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3356
diff changeset
    67
	<mkdir dir="${build.libs.dir}"/>
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    </target>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
    <target name="libs.fetch" if="ivy.dep.file.present">
3387
79624c24b4d8 buildfiles: oops, build Java classes with debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3356
diff changeset
    70
	<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar}" />
79624c24b4d8 buildfiles: oops, build Java classes with debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3356
diff changeset
    71
	<ivy:retrieve conf="binaries" pattern="${build.libs.dir}/[artifact]-[revision].[ext]" />
79624c24b4d8 buildfiles: oops, build Java classes with debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3356
diff changeset
    72
	<ivy:retrieve conf="sources"  pattern="${build.libs-src.dir}/[artifact]-[revision].[ext]" />
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
    </target>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
    <target name="libs" depends="libs.pre, libs.main, libs.fetch, libs.post"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
    <extension-point name="clean.pre"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
    <extension-point name="clean.post"/>
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    78
    
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
    <target name="clean.main">
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    80
       <delete dir="${build.bin.dir}" />
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    81
       <delete dir="${build.bin-tests.dir}" />
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    </target>
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    83
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    84
    <target name="clean" depends="clean.pre, clean.main, clean.post"/>
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    <target name="clobber" depends="clean"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
	<target name="echo.properties">
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
		<echoproperties/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
	</target>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
	<target name="echo.classpath">
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
		<pathconvert property="build.classpath" refid="build.classpath"/>
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
		<echo>build.classpath: ${build.classpath}</echo>
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    94
		<pathconvert property="test.classpath" refid="test.classpath"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    95
		<echo>test.classpath: ${test.classpath}</echo>
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
	</target>
3541
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    97
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    98
    <target name="test" depends="test.pre, test.main, test.post"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
    99
    <extension-point name="test.pre"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   100
    <extension-point name="test.post"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   101
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   102
    <target name="test.main" depends="test.compile, test.run"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   103
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   104
    <target name="test.compile" depends="compile, test.compile.pre, test.compile.main, test.compile.post"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   105
    <extension-point name="test.compile.pre"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   106
    <extension-point name="test.compile.post"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   107
    <target name="test.compile.main" depends="compile" if="${build.src-tests.dir.present}">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   108
        <mkdir dir="${build.bin-tests.dir}"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   109
        <javac srcdir="${build.src-tests.dir}"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   110
               destdir="${build.bin-tests.dir}"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   111
               classpathref="test.classpath"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   112
               debug="true"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   113
               debuglevel="lines,vars,source"
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   114
               includeantruntime="false"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   115
    </target>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   116
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   117
    <target name="test.run" depends="test.compile, test.run.pre, test.run.main, test.run.post">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   118
   	<fail  message="One or more test(s) failed. See aboce" 
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   119
        	    if="test.failure" />
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   120
    </target>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   121
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   122
    <extension-point name="test.run.pre"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   123
    <extension-point name="test.run.post"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   124
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   125
    <target name="test.run.main" if="${build.src-tests.dir.present}">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   126
        <mkdir dir="${test.report.dir}"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   127
        <junit failureproperty="test.failure">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   128
            <classpath>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   129
                <path refid="test.classpath"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   130
            </classpath>            
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   131
            <formatter type="plain"/>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   132
            <batchtest todir="${test.report.dir}">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   133
                <fileset dir="${build.src-tests.dir}">
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   134
                    <include name="**/*.java"/>                    
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   135
                    <exclude name="**/mocks/**/*.java"/>                    
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   136
                </fileset>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   137
            </batchtest>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   138
        </junit>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   139
    </target>
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   140
69805e2d87e6 Build files: added ant target `test` to build and run tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3387
diff changeset
   141
3327
3f9968ddacf8 Ant build files refactoring (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
</project>