Testing in iOS, Episode 2: XCTestCase | raywenderlich.com

“Test cases” are groups of related test methods. They exist within test targets, which have two ways to access code from other modules.

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/25842120-testing-in-ios/lessons/2

Why do we delete the two files XCTestManifests.swift and LinuxMain.swift. Is it a recommended practice to always delete those two files?

They’re only useful if you plan to run the code on non-Apple platforms. XCTest requires the Objective-C runtime, which isn’t present elsewhere.

Feel free to leave them there if you’re targeting Linux or Windows!

1 Like

May I know why “is it not enough of just using”:

@testable import MyLibrary

More details will be appreciated. cheers

@testable import MyLibrary is enough.
import MyLibrary is not enough.

What I go over in the interlude starting at 7:33 is that @testable allows for a test target to gain access to the internal code of an imported module.