3

Unit tests always show 'succeed' desktop notification when run on device in XCode 6 beta 6 in Swift.

How to recreate:

  • Create new iOS single-view app project with Swift.
  • Go to the existing test and change it to XCTAssert(false) to make it fail.
  • Run the tests on the device - it shows "Test Succeeded" desktop notification.
  • Run the test on the emulator - it shows "Test Failed" notification as it should.

Update

  • There are test error messages in the output window when testing on device. But the desktop notification says "Test Succeeded".
  • When I test on device and set a breakpoint in the test method - it does stop there.
Evgenii
  • 33,381
  • 26
  • 125
  • 160
  • 1
    Set a breakpoint on all exceptions and run it again. Static asserts don't just get optimized away (unless they've been turned off somehow). – CodaFi Aug 20 '14 at 05:03
  • Same problem. I get a sucess notification no matter how I run my tests, but looking at my console logs I clearly see that some tests fail. There aren't any success or failure icons in the tests tab of my project either. – isair Sep 03 '14 at 01:41

1 Answers1

1

Run the test on the emulator - it shows "Test Failed" notification as it should.

Copied from the Question, in case someone doesn't realize there is a way to get them to work (although not on device).

Ali Saeed
  • 1,332
  • 1
  • 15
  • 22