Frage

I'm trying to create my first XCTestCase within my existing iOS+Mac project. I created a new test class, and I see that it created a new test target for me in my project, but the new scheme has none of the linked libraries and source code files from my existing target. It just shared the scheme from the existing target, but none of the project details. I don't want to go add each and every source file and framework library into the new test target. Is there a way to simply create a new test target that is a clone of an existing target? Or add all source files into my target without it being

War es hilfreich?

Lösung

When set up correctly, the test bundle is linked against your app. You shouldn't put any production code into your test target, only test code.

Andere Tipps

I was probably doing something wrong in how I setup the test target. You can create a new test Target, (from New -> Target -> Unit Testing Bundle), set it up from an existing target, and it should build and link just fine, and you can import any existing files into the test class.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top