Xcode 6.1 does not detect unit tests until runtime

I ran into a problem when Xcode 6.1.1 did not detect the unit test file. I started the circuit with which it was connected, and the file was found at runtime and as a result the “rT” icon appeared next to it in the unit test navigator. This led me to this question , but none of the answers work for me. No amount of deletion of my received data or restarting Xcode helps. The only thing that came close to work was deleting my derived data folder while Xcode was running - when it re-indexed it, all the test files were found in one of my three schemas.

All of these tests have been discovered in the past - I think it all broke down during reindexing.

Has anyone seen this and found a solution? I would like my tests to be detected before execution, so I can easily run them individually.

+6
source share
3 answers

I came across this, but removing Derived Data worked for me:

  • Close Xcode
  • Terminal: cd ~ / Library / Developer / Xcode / DerivedData /
  • Terminal: rm -Rf *
  • Open Xcode and wait for it to re-index the project.

However, you stated that this does not fully work for you. Perhaps you should also try deleting the Xcode cache directory?

  • Close Xcode
  • Terminal: cd ~ / Library / Caches / com.apple.dt.Xcode /
  • Terminal: rm -Rf *
  • Open Xcode and wait for it to re-index the project.
+11
source

This happened to me on Xcode 7.2 as well. To fix the problem, I performed the following steps:

  • I deleted Derived Data by choosing Window -> Project -> clicking the arrow next to the Derived Data pool and deleting all the files in the folder.
  • Close and restart Xcode.

It took some time to index the files, and then all the tests appeared in the test navigator.

+1
source

I have the same problem in 6.1.1 too.

The workaround I found is to create a new test target. When the test case disappears, select it in the navigator and move it from the original test target to a new one, and then again (perhaps with a pause before moving it back) - I’m not sure if this is really necessary, though). It doesn’t always work, but it often seems that Xcode causes a test case to be remembered - if it doesn’t work the first time, as usual, it repeats.

I will also let delete derived data too: note that this can be done from within Xcode (Window / Organizer / Projects - click Delete next to the derived data) - it may be faster, but a reboot may still be necessary - some more experimentation is required.

Ali

0
source

Source: https://habr.com/ru/post/979797/


All Articles