Error "The module was not compiled for testing" when using the Swift package manager

I created the Swift c library swift package init --type libraryand generated an Xcode c project swift package generate-xcodeproj.

Now I am trying to run a test circuit in Xcode. It prints the following error:

Module '<title>' was not compiled for testing

However, when I run swift build, and swift testin the terminal, it works fine.

I have ENABLE_TESTABILITYinstalled on YESfor all purposes. I did not change anything in the project, except for this. How can I make Xcode do unit testing?

+4
source share
3 answers

, , @testable , Swift Package Manager.

@testable import . , , .

0

  • ,
  • → → .
0

" " "" " "

enter image description here

0

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


All Articles