-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
152 lines (133 loc) · 4.83 KB
/
build.xml
File metadata and controls
152 lines (133 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<project name="Asdf" default="compile" basedir=".">
<!-- * Properties -->
<property name="classOutputDir" value="build" />
<property name="test-suite" value="*" />
<!-- major-specific -->
<property name="mutation" value=":ALL"/>
<property name="mutator" value="-XMutator${mutation}"/>
<property name="major" value="major/bin/javac"/>
<!-- TARGETS -->
<!-- ** clean -->
<target name="clean" description="Clean">
<delete dir="${classOutputDir}"/>
<delete>
<fileset dir="csvfiles" erroronmissingdir="no" includes="*.csv"/>
<fileset dir="." includes="*.csv"/>
<fileset dir="." includes="*.log"/>
</delete>
</target>
<!-- ** init -->
<target name="init" depends="clean">
<mkdir dir="${classOutputDir}"/>
<mkdir dir="csvfiles"/>
</target>
<!-- ** compile -->
<target name="compile" depends="init">
<mkdir dir="${classOutputDir}/classes" />
<!-- Essential that line numbers and filenames are included in order for PIT to work -->
<javac srcdir="src"
includeantruntime="false"
debug="true"
debuglevel="source,lines"
destdir="${classOutputDir}/classes" />
</target>
<!-- major-compile -->
<target name="compile.major" depends="init" description="Compile for major">
<delete dir="mutants"/>
<mkdir dir="${classOutputDir}/classes" />
<javac includeantruntime="true"
srcdir="src"
destdir="${classOutputDir}/classes"
debug="yes"
fork="yes"
executable="${major}">
<compilerarg line="${mutator} -J-Dmajor.export.mutants=true"/>
</javac>
</target>
<!-- JUnit-specific -->
<!-- test path -->
<path id="test.path">
<pathelement location="${classOutputDir}/classes" />
<pathelement location="${classOutputDir}/test-classes" />
<fileset dir="lib" includes="*.jar"/>
</path>
<!-- compile.tests -->
<target name="compile.tests" depends="compile" description="Compile all tests">
<mkdir dir="${classOutputDir}/test-classes" />
<javac includeantruntime="false"
srcdir="test"
destdir="${classOutputDir}/test-classes">
<classpath refid="test.path" />
</javac>
</target>
<!-- test:run junit tests -->
<target name="test" depends="compile.tests" description="Run specified tests">
<mkdir dir="${classOutputDir}/test-result" />
<junit>
<classpath refid="test.path" />
<batchtest todir="${classOutputDir}/test-result">
<!-- set test classes -->
<fileset dir="test">
<include name="**/${test-suite}.java" />
</fileset>
<formatter type="xml" />
</batchtest>
</junit>
<junitreport todir="${classOutputDir}/test-result">
<fileset dir="${classOutputDir}/test-result">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${classOutputDir}/test-result/report" />
</junitreport>
</target>
<!-- major-compile-test -->
<target name="compile.tests.major" description="Compile all tests for major">
<mkdir dir="${classOutputDir}/test-classes" />
<javac includeantruntime="true"
nowarn="true"
srcdir="test"
destdir="${classOutputDir}/test-classes/"
debug="yes"
fork="yes"
executable="${major}">
<classpath refid="test.path" />
</javac>
</target>
<!-- major-run-mutation -->
<target name="test.major" description="Run all unit test cases">
<echo message="Running unit tests ..."/>
<junit printsummary="true"
showoutput="true"
haltonfailure="false">
<classpath refid="test.path" />
<formatter type="plain" usefile="false"/>
<classpath path="${classOutputDir}"/>
<batchtest fork="no">
<fileset dir="test">
<include name="**/${test-suite}.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="mutation.test.major" description="Run mutation analysis for all unit test cases with major">
<echo message="Running mutation analysis ..."/>
<junit printsummary="false"
showoutput="false"
mutationAnalysis="true"
exportKillMap="true"
killMapFile="../csvfiles/killMap.csv"
resultFile="../csvfiles/results.csv"
killDetailsFile="../csvfiles/killed.csv"
summaryFile="../csvfiles/summary.csv"
testMapFile="../csvfiles/testMap.csv"
mutantsLogFile="../mutants.log">
<classpath refid="test.path" />
<classpath path="${classOutputDir}/classes"/>
<batchtest fork="nofalse">
<fileset dir="test">
<include name="**/${test-suite}.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>