Ant : Junit failure triggers a haltonfailure

旧巷老猫 提交于 2019-12-11 09:59:01

问题


I have found that the following :

<junit haltonfailure="no" haltonerror="no" >
   <!-- some tests guaranteed to call Assert.fail(); --> 
</junit>

Will not prematurely halt (all tests will run).

HOWEVER ...... The following

<junit haltonfailure="no" haltonerror="yes" >

Will fail after the FIRST failed test. Note that in this case, I'm guaranteeing that the test is failing via Assert.fail();

This, I am assuming that either

1) Ant considers an ERROR to be a subclass of a FAILURE. or

2) There is a oddity in the way ant percieves failures - that is, failures are treated (erroneously) as errors when deciding to halt.

My Question : Why would ant would halt on a test failure (even when explicitly configured with haltonfailure="no"). Any thoughts could be very enlightening ! Thanks.

UPDATE

I now realize that this is clearly an RTFM question which is covered in the ant http://ant.apache.org/manual/Tasks/junit.html (see correct answer below).


回答1:


Quote from junit ant task documentation:

haltonfailure: Stop the build process if a test fails (errors are considered failures as well).

So the answer is: ant junit considers failures as errors, hence the stop of the build



来源:https://stackoverflow.com/questions/10936140/ant-junit-failure-triggers-a-haltonfailure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!