source: CIVL/build.xml@ 92ccda3

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 92ccda3 was 92ccda3, checked in by Stephen Siegel <siegel@…>, 12 years ago

Organizing test suite into 3 distinct categories.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1567 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 6.8 KB
RevLine 
[173ff32]1<!--
2 build.xml : Ant build file for CIVL
3 Author: Stephen F. Siegel, University of Delaware
4 Last modified:
5
6 The following can be defined on command line with -Dprop=val:
7 revision. This is for the use of our SVN commit hook, which
8 runs the test suite and performs other tasks every time a commit
9 is made. The SVN revision number is just used here to insert
10 into reports.
11-->
12
[12af7b8]13<project name="CIVL" basedir="." default="jar" xmlns:jacoco="antlib:org.jacoco.ant">
[173ff32]14
15 <!-- Directories -->
16
[d005d94]17 <condition property="properties.file" value="build.properties" else="build_default.properties">
18 <available file="build.properties" />
19 </condition>
20 <property file="${properties.file}" />
[eb6952c]21 <property file="build.properties" />
[173ff32]22 <property name="src.dir" value="${basedir}/src" />
23 <property name="bin.dir" value="${basedir}/bin" />
24 <property name="javadoc.dir" value="${basedir}/doc/javadoc" />
25 <property name="jar-name" value="civl.jar" />
26 <property name="jar-path" value="${basedir}/${jar-name}" />
[dad210da]27 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
[173ff32]28
[12af7b8]29 <!-- Junit and JaCoCo Coverage -->
[173ff32]30
[92ccda3]31 <property name="test.src.dir" location="${basedir}/test/regress" />
32 <property name="test.bin.root.dir" location="${basedir}/bin-test" />
33 <property name="test.bin.dir" location="${test.bin.root.dir}/regress" />
[173ff32]34 <property name="junit.dir" location="${basedir}/junit" />
35 <property name="junit.data.dir" location="${junit.dir}/data" />
36 <property name="junit.reports.dir" location="${junit.dir}/reports" />
[12af7b8]37 <property name="coverage.dir" location="${basedir}/coverage" />
38 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
39 <classpath path="${jacoco.jar}" />
40 </taskdef>
[173ff32]41
[6f2b49d]42 <!-- Benchmark -->
43
44 <property name="bench.src.dir" location="${basedir}/bench" />
[173ff32]45
46 <!-- Source compilation and JAR construction -->
47
48 <path id="src.compile.classpath">
49 <pathelement location="${src.dir}" />
[290908a]50 <pathelement location="${sarl.jar}" />
51 <pathelement location="${gmc.jar}" />
52 <pathelement location="${abc.jar}" />
[173ff32]53 </path>
54
[3c84707]55 <target name="compile" description="Compile all java source files.">
[173ff32]56 <mkdir dir="${bin.dir}" />
[e31fe2c]57 <javac debug="true" srcdir="${src.dir}" destdir="${bin.dir}" includes="edu/udel/cis/vsl/civl/**" classpathref="src.compile.classpath" encoding="UTF-8" includeantruntime="false">
[173ff32]58 </javac>
59 </target>
60
61 <target name="jar" depends="compile" description="Jar up all class files.">
62 <jar destfile="${jar-path}">
63 <fileset dir="${bin.dir}" />
[290908a]64 <zipfileset includes="**/*.class" src="${abc.jar}" />
65 <zipfileset includes="**/*.h" src="${abc.jar}" />
[20029e1]66 <zipfileset includes="**/*.cvh" src="${abc.jar}" />
[290908a]67 <zipfileset includes="**/*.class" src="${gmc.jar}" />
68 <zipfileset includes="**/*.class" src="${sarl.jar}" />
[cf6afad]69 <fileset dir="${basedir}/images" />
[f8cc302]70 <fileset dir="${basedir}/text/include" />
[af8a6cb]71 <fileset dir="${basedir}/lib" />
[173ff32]72 <manifest>
73 <attribute name="Built-By" value="${user.name}" />
74 <attribute name="Main-Class" value="${main-class}" />
75 </manifest>
76 </jar>
77 </target>
78
79 <!-- Plain JUnit tests -->
80
81 <path id="test.compile.classpath">
82 <pathelement location="${test.src.dir}" />
83 <pathelement location="${bin.dir}" />
84 <pathelement location="${junit.jar}" />
[d75e0d7]85 <pathelement location="${hamcrest.jar}" />
[290908a]86 <pathelement location="${sarl.jar}" />
87 <pathelement location="${gmc.jar}" />
88 <pathelement location="${abc.jar}" />
[173ff32]89 </path>
90
91 <path id="test.execute.classpath">
92 <pathelement location="${test.bin.dir}" />
93 <pathelement location="${bin.dir}" />
94 <pathelement location="${junit.jar}" />
[d75e0d7]95 <pathelement location="${hamcrest.jar}" />
[290908a]96 <pathelement location="${sarl.jar}" />
97 <pathelement location="${gmc.jar}" />
98 <pathelement location="${abc.jar}" />
[f8cc302]99 <pathelement location="${basedir}/text/include" />
[173ff32]100 </path>
101
102 <target name="test-init">
103 <delete dir="${junit.dir}" quiet="true" />
104 <delete dir="${test.bin.dir}" quiet="true" />
105 <mkdir dir="${junit.dir}" />
106 <mkdir dir="${junit.data.dir}" />
107 <mkdir dir="${junit.reports.dir}" />
108 <mkdir dir="${test.bin.dir}" />
109 </target>
110
111 <target name="test-compile" depends="compile,test-init">
[e31fe2c]112 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
[173ff32]113 <src path="${test.src.dir}" />
114 </javac>
115 </target>
116
[12af7b8]117 <target name="test-run" depends="test-compile">
118 <jacoco:coverage>
[9ac0d73]119 <junit fork="true" forkmode="once" timeout="300000">
[12af7b8]120 <jvmarg value="-ea" />
121 <classpath refid="test.execute.classpath" />
122 <formatter type="brief" usefile="false" />
123 <formatter type="xml" />
124 <batchtest todir="${junit.data.dir}">
125 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
126 </batchtest>
127 </junit>
128 </jacoco:coverage>
[173ff32]129 <junitreport todir="${junit.data.dir}">
130 <fileset dir="${junit.data.dir}">
131 <include name="TEST-*.xml" />
132 </fileset>
133 <report format="frames" todir="${junit.reports.dir}">
[92ccda3]134 <param name="TITLE" expression="JUnit Report for CIVL ${revision} Regression Suite" />
[173ff32]135 </report>
136 </junitreport>
137 </target>
138
[12af7b8]139 <target name="test" depends="test-run">
140 <jacoco:report>
141 <executiondata>
142 <file file="jacoco.exec" />
143 </executiondata>
[92ccda3]144 <structure name="Test Coverage Report for CIVL ${revision} Regression Suite">
[12af7b8]145 <classfiles>
146 <fileset dir="${bin.dir}" />
147 </classfiles>
148 <sourcefiles encoding="UTF-8">
149 <fileset dir="${src.dir}" />
150 </sourcefiles>
151 </structure>
152 <html destdir="coverage" />
153 </jacoco:report>
[173ff32]154 </target>
155
[6f2b49d]156 <!-- Benchmark Tasks -->
157
158 <target name="bench-compile" depends="jar" description="Compile benchmark java source files.">
159 <mkdir dir="${bin.dir}" />
[3f2c5eb]160 <javac debug="true" srcdir="${bench.src.dir}" destdir="${bin.dir}" includes="edu/udel/cis/vsl/civl/**/*Benchmark.java" classpathref="src.compile.classpath" encoding="UTF-8" includeantruntime="false">
[6f2b49d]161 </javac>
162 </target>
[173ff32]163
164 <!-- Javadoc Tasks -->
165
166 <target name="javadoc">
167 <delete dir="${javadoc.dir}" quiet="true" />
168 <mkdir dir="${javadoc.dir}" />
[45abec4]169 <javadoc destdir="${javadoc.dir}" Overview="src/overview.html" author="false" version="true" use="true" windowtitle="API for CIVL ${revision}" access="public" classpathref="test.execute.classpath" failonerror="false">
170 <packageset dir="${src.dir}" defaultexcludes="yes">
171 <include name="**/IF" />
172 <include name="**/IF/**" />
173 <include name="edu/udel/cis/vsl/civl" />
174 </packageset>
[173ff32]175 </javadoc>
176 </target>
177
178 <!-- Clean -->
179
180 <target name="clean" description="Delete all generated files.">
181 <delete dir="${bin.dir}" />
[92ccda3]182 <delete dir="${test.bin.root.dir}" />
[173ff32]183 <delete dir="${junit.dir}" />
184 <delete dir="${javadoc.dir}" />
[12af7b8]185 <delete dir="${coverage.dir}" />
[173ff32]186 <delete file="${jar-path}" />
[12af7b8]187 <delete file="${basedir}/jacoco.exec" />
[173ff32]188 <delete file="${manifest-file}" />
189 </target>
190
191 <!-- Do everything -->
192
[6f2b49d]193 <target name="all" depends="jar,test,javadoc,bench-compile" />
[173ff32]194
195</project>
Note: See TracBrowser for help on using the repository browser.