Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#41 CUnit task similar to JUnit for executable unit tests

cpptasks (35)

For projects developing code in C/C++
there is a need to have an Ant task to
run executable unit tests (to be integrated
in the CruiseControl continuous builds)

We was needed is a task <cunit>
similar to <junit> for which we can specify
the executables (as a fileset) and one
that produces output that is compatible
with junitreport so it will work with CC

The current implementation is a bit of
a hack - only the fileset feature was needed
and is implemented. The CUnit task was not
developed as an independent (standalone)
ant task because it makes use of code in
JUnit (a lot of the functions are private
to the package or final so creating another
package was not possible/feasible)

How to compile the CUnit task

Ant 1.6.5 use source distribution
download source .zip, unzip to C:\cygapps

in .bash_profile add env
variable ANT_HOME to point to this location
and add $ANT_HOME/bin to the path

on cygwin prompt
./ (bootstrapped build for ant)

for building <cunit> Ant Task
- copy sources,,,
to the junit directory (under
Optional tasks)
- WARNING : copy junit.jar
(look at
for javadoc and
group_id=15278 for the binary )
to the lib directory
otherwise ant-junit will not be built
- do the following to build sources
ant allclean
ant jars

- the CUnit Ant Task is packaged in
ant-junit.jar. This needs to be copied to CC
under main\lib\ant and reporting\jsp\lib
for the unit tests to work under CC