https://issues.apache.org/bugzilla/show_bug.cgi?id=55697

            Bug ID: 55697
           Summary: JUnit tests skipped by haltonerror or haltonfailure
                    are missing from skipped test reporting
           Product: Ant
           Version: nightly
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks
          Assignee: [email protected]
          Reporter: [email protected]

The ability to report skipped tests was recently added to the Ant JUnit
reporting (in March 2013 / bug 54670). When the "haltonerror" or
"haltonfailure" directives are used in the junit task, and the build does halt
before running all the tests, then the resulting skipped tests should be
reported via this mechanism as well. (Whether you consider this a bug or a
feature, it would still be good.)

Software versions used to repro:
 Apache Ant(TM) from SVN, version 1.9.3alpha retrieved and compiled on October
21 2013
 Apache Ant(TM) version 1.9.2 also has this issue
 JUnit 4.11 (with Hamcrest-core 1.3)
 Java version 1.7.0

How to reproduce:
 Create the following files and then run "ant" in the directory. Note that the
test "TestFail.test3" was skipped, but there is no XML report of this getting
skipped. The build directory should contain a report stating that a test was
skipped.

== build.xml ==
<project name="Repro" default="tests" basedir=".">

  <target name="compile">
     <mkdir dir="build"/>
     <javac srcdir="src" destdir="build">
        <classpath><path
path="../hamcrest-core-1.3.jar:../junit-4.11.jar"/></classpath>
     </javac>
     <jar jarfile="Repro.jar" basedir="build"/>
  </target>

  <target name="tests" depends="compile">
     <junit 
        haltonerror="true" haltonfailure="true"
        outputtoformatters="true" showoutput="true">
        <formatter type="xml" usefile="true"/>
        <test name="com.amazon.TestFailFail" todir="build"/>
        <test name="com.amazon.TestFail" todir="build"/>
        <classpath><path
path="../hamcrest-core-1.3.jar:../junit-4.11.jar:Repro.jar"/></classpath>
     </junit>
  </target>

  <target name="clean">
     <delete dir="build"/>
     <delete file="Repro.jar"/>
  </target>

</project>

== src/com/amazon/TestFailFail.java ==
package com.amazon;
import static org.junit.Assert.fail;
import org.junit.Test;

public class TestFailFail
{
    @Test public void test1()
    { fail("I am test1 fail."); }

    @Test public void test2()
    { fail("I am test2 fail."); }
}

== src/com/amazon/TestFail.java ==
package com.amazon;
import static org.junit.Assert.fail;
import org.junit.Test;

public class TestFail
{
    @Test public void test3()
    { fail("I am test3 fail."); }
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to