Android Unit Test Not Reporting Failing with fail()

Viewed 569

I've written a unit test that simply extends TestCase and I have the following:

public class MetricParserTests extends TestCase {

    @Override
    protected void setUp() throws Exception {
        super.setUp();
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void testFailure() {
        fail("This needs to fail");
    }
}

When I run my tests using ant test or adb shell am instrument I get the following results:

... [exec] OK (1 tests) ...

I'd expect to see a failure on the command line.

3 Answers
Related