0
votes

I try to add test-cases to my swift-project.

enter image description here

When I add the test-Target to the Class-Target-Membership a lot of errors appear. e.g.:

Use of undeclared type 'TYPE'

Use of unresolved identifier 'IDENTIFIER'

'MyClass.Type' does not have a member named 'myFunc' 

I thought maybe it has something to do with the access control but by default everything should be internal and also available in all of my Targets. I know this are not much information but I hope anyone of you can just tell me that I overviewed something.

What do you mean by "add the test-Target to the Class-Target-Membership"? Update your question to provide more detail on what you are doing with regard to adding test classes and targets to your project. With more information on what you are doing, someone will be more likely to be able to answer your question. - Swift Dev Journal
thank you! I added a picture of what I mean - Michael
On what files are you selecting the checkboxes in your screenshot? For Swift test files, you should be selecting the unit test target, not the app target. - Swift Dev Journal
The screenshot shows how it works great. When I also select the Tests-Target I get the compiler errors as written above - Michael
The Swift test files should have only the unit test target selected. If you are still getting compiler errors, try making your app's Swift files members of both targets. - Swift Dev Journal