How can I have the Ant JUnit task run all tests and then stop the rest of the build if any test has failed

后端 未结 1 1137
感情败类
感情败类 2020-12-16 12:01

I\'m running JUnit via Ant using a target something like this:


    
            


        
相关标签:
1条回答
  • 2020-12-16 12:31

    You can set the failureproperty attribute of the junit task, then test the property afterwards with the fail task:

    <junit haltonfailure="no" failureproperty="test.failed" ... >
       ...
    </junit>
    <fail message="Test failure detected, check test results." if="test.failed" />
    
    0 讨论(0)
提交回复
热议问题