我编写了一个单元测试,只是扩展了TestCase,我有以下内容:
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"); } }
当我使用测试运行ant test
或adb shell am instrument
得到以下结果时:
... [exec] OK(1次测试)......
我希望在命令行上看到失败.