Tests navigator in xcode 7 says (null) - ios

When I try to test my iOS app the Xcode 7 test navigator shows (null) the second time I run my tests.
The first time it looks normal:
However, as I run the tests again the 12 tests turn into a single test named (null) and it feels like the test cases aren't really run anymore, they just succeed every time after 1 millisecond.
I'm using Kiwi for the tests, but it feels more like something going wrong in Xcode7. I don't remember having this problem in Xcode6. The only thing that consistently solves the problem seems to be an Xcode reboot.
Has anyone had this issue as well?

I have just experienced the same issue. Commenting out the test class name so the test would not build and then putting the test class name back fixed it for me.

Related

iOS Test Suite crashes after running xctest.xctwaiter

This has been happening with xcode 9 and xcode10 now, using Quick and XCTest for unit tests they will run all the way fine but throw an exception/crash at the end. If I continue the tests will succeed.
I've spent so many hours trying to figure this out with no luck. I don't see anything helpful in the logs or stack trace. It's a big code base with 2,000+ tests so it's hard to figure out if it's just one causing it. I've tried:
Removing all files from test target, adding 1 by 1, at some point it breaks again but moving back to previous OK version now starts to fail.
deleting all async tests from both Quick and XCTest
Deleting all XCTEst cases, to see if it's an issue of both in 1 target.

Xcode test cases shows no test coverage

I'm having problem with getting code coverage in Xcode. It was working at some point of time, however after sometime it has just stopped showing coverage. I've checked both the schemes and test coverage plane for the appropriate settings.
This is how my scheme looks like:
This is what my test coverage plane shows after running test cases:
I tried many many things to get this fixed. Finally I ended up deleting all Xcode I had in the Mac, and cleared all the meta-data from /Users/bbirani/Library/Developer/. After all this clean-up, I re-installed Xcode and VOILAA!! it started working.
It happens to me a lot. Try restarting your xcode as well as the simulator(if you are using one). It seems like an xcode issue.
You can try some of this
Enabling the "show code coverage" from Editor while running a test case. I had this same problem before worked for me. Just try and see if that is working.
You can try checking the targets for the modules but not sure thats the case.
Or you can use the #testable way.This is a workaround and the long way to solve this.
Also u can try cleaning the whole project and deleting any derived data.And then try running the test case.
Also you can try deleting the scheme and try making a new scheme and check "Gather coverage data" for the same. If this things work then thats a xcode bug.
I hope your problem gets solved, I got stuck to the same problem before and it was frustrating to solve that, and you never know which way might work.
Maybe try using Slather instead?
https://cocoacasts.com/how-to-generate-code-coverage-reports-in-xcode-with-slather

Xcode 7 test fails but shows successful

I am not sure if I am making a mistake or there is a bug.
I have setup 2 tests. One of them fails one doesn't but the test suit gets the checkmark.
it seems like there has been a similar issue before in Xcode 5 but this was not useful to me.
http://stackoverflow.com/questions/19233626/xcode-5-says-tests-failed-but-shows-green-checkmarks
This is what I followed to setup kiwi
I appreciate the help.

Code coverage do not include code covered with UITests

In my simple app I have a few files that are tested by unit testing and uitesting.
I am pretty sure that in UITests I tested EVERY line in WLLoginViewController. The test passed, but it is not considered as 100% in code coverage for that file. Sometimes when I restart Xcode, run app again, clean app, hard clean app. Do some accidental things, it works. But run tests once again, and again it is not considered. Why? Any ideas how to fix it? Is it a bug?
As you already mentioned, sometimes Xcode says that you are testing 100% of your code and sometimes it doesn't. So it's really inconsistent. That is an indicator for a bug.
Since you are still using an Xcode-beta, it's most likely a bug in Xcode. I wouldn't worry to much since it's still a beta-version and would check later, when the final version is released.
Ok, I've found temporary workaround.
Remove derived data for your project (window->projects)
Quit Xcode and Simulator.
Launch Xcode with your project, and run tests.
Run tests again.
Remember to wait until indexing is finished:
Weird, but try and see:)

Unit testing problems and crashing with XCode 5 and Kiwi/XCUnit

I'm having many issues with unit testing in XCode 5 and want to verify if anybody else if having the same problems (and any possible solutions...) I'm using the Kiwi framework developing for ios7 and its a new project therefore is using XCUnit underneath. I'm on a 2011 macbook air on OSX 10.8
The first time I run a test on startup, it runs all tests, even if I only select one case/test class - it even runs all the disabled ones.
Upon adding new unit tests, there is ~1/3 chance that XCode crashes on running all tests.
Clicking on failed unit tests very rarely takes me to the failed unit tests. It acts as if the code has been deleted.
When unit tests have been fixed, errors are often left over both in the issue navigator and in the editor however test is now reporting to succeed.
Upon successful running of all unit tests Xcode often reports that Tests have failed however all show as successful in the navigator.
Unit tests quite regularly get 'stuck' and execute forever. Its then impossible to run/build anything else until have restarted xcode.
Anybody with a similar setup having the same issues? Any solutions? What a bloody mess.
It seems that Xcode 5.1 (DP) will solve your issues.
Yes I get similar problems, also using Kiwi. No idea if its Kiwi related, but certainly I experience crashes when running unit tests, perhaps about 1 in 5 runs, and more often if the program hits a breakpoint and I run the tests again with Cmd-U.
I haven't been using the 'test single' option, so can't comment there.
The errors left over problem appears to be generic to unit tests, not just Kiwi. If you delete the block that contains the left over error, wait a few secs for Xcode to recompile in the background and paste it back it, you'll get rid of it. Or exit and restart Xcode if you have a bunch of them.

Resources