GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Cobertura unit test coverage. · cmitch9/sample-java-project@969b9f5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • build.xml
  • ivy.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎build.xml‎

Copy file name to clipboardExpand all lines: build.xml
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,33 @@
171171
<copy todir="${build.dir}/test">
172172
<fileset dir="${test.dir}" excludes="**/*.java"/>
173173
</copy>
174+
<!-- Test coverage -->
175+
<taskdef classpathref="test.classpath" resource="tasks.properties"/>
176+
<cobertura-instrument todir="${build.dir}/instrumented"
177+
datafile="${build.dir}/cobertura.ser">
178+
<fileset dir="${build.dir}/classes">
179+
<include name="**/*.class"/>
180+
</fileset>
181+
</cobertura-instrument>
174182
</target>
175183

176184
<target name="test" depends="test-compile" description="Run the unit tests.">
177185
<junit fork="yes">
178186
<classpath>
187+
<pathelement path="${build.dir}/instrumented"/>
179188
<pathelement path="${build.dir}/classes"/>
180189
<pathelement path="${build.dir}/test"/>
181190
<path refid="test.classpath"/>
182191
</classpath>
192+
<sysproperty key="net.sourceforge.cobertura.datafile"
193+
file="${build.dir}/cobertura.ser"/>
183194
<batchtest>
184195
<formatter type="brief" usefile="false"/>
185196
<fileset dir="${build.dir}/test"/>
186197
</batchtest>
187198
</junit>
199+
<cobertura-report srcdir="${src.dir}" destdir="${dist.dir}/test"
200+
datafile="${build.dir}/cobertura.ser"/>
188201
</target>
189202

190203
<!-- Maven repository support -->
Collapse file

‎ivy.xml‎

Copy file name to clipboardExpand all lines: ivy.xml
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<!-- Unit Test -->
1919
<dependency org="junit" name="junit" rev="4.10"
2020
conf="test->default"/>
21+
<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9.4.1"
22+
conf="test->default">
23+
<exclude module="ant"/>
24+
</dependency>
2125

2226
<!-- Static Analysis -->
2327
<dependency org="com.puppycrawl.tools" name="checkstyle" rev="5.5"

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.