Ant task to verify results of a test run, can fail a build if certain conditions are not met


expectedErrorsintNumber of errors that are expected (optional)
expectedFilesintNumber of files that are expected to be processed (optional)
modeStringThe comparison mode to use. The legal values are EQUALS, NOT_EQUALS, LESS_THAN, LESS_THAN_OR_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUALS
reportStringThe report file to process. Default value is: "reports/parasoft/test.xml"


<?xml version="1.0"?>
<project name="Parasoft Build" default="parasoft-build" xmlns:parasoft="antlib:com.parasoft.antlib">
    <import file="build.xml"/> <-- import the original build script -->

    <target name="parasoft-init">
        <parasoft:monitor id="monitor" /> <!-- install the monitor -->

    <target name="parasoft-build" depends="parasoft-init, compile"> <!-- compile is from the original build script -->
        <parasoft:jtest config="builtin://Static Analysis">
            <projectDescription monitorref="monitor"/> <!-- the reference to the monitor for use in the jtest execution -->
        <parasoft:verify expectedErrors="10" mode="GREATER_THAN"/> <!-- verify that 10 is GREATER_THAN the total number of errors,
                                                                        or else a build failure with be occur -->