Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SenTesting stop test after first STAssert fails

Is there a way to stop execution of an iOS unit test once the first STAssert fails?

For example if I have multiple STAsserts:

STAssertTrue([myobject succeeded], @"failed");
STAssertNotNil(foo,@"bar");

I would love it if Xcode simply stopped executing the test after the first one fails. Any way to do this?

like image 913
Msencenb Avatar asked Nov 14 '22 04:11

Msencenb


1 Answers

If you have an Exception Breakpoint set for all exceptions, Xcode will throw to the debugger on the first failed test. If you're running tests manually within Xcode this might be acceptable.

To setup an exception breakpoint within Xcode 4+

  1. View > Navigators > Show Breakpoint Navigator
  2. Click the + button at bottom left of the Breakpoint Navigator window, choose "Add Exception Breakpoint"
  3. Click "Done" in the popover that appears.

Xcode will break to the debugger on any exceptions encountered at application runtime.

like image 180
alexkent Avatar answered Nov 16 '22 04:11

alexkent