Reputation: 515
Running simple unit-test for an iOS app.
Sample Test:
import XCTest
@testable import SDKTestAppSwift
class SDKTestAppSwiftTests: XCTestCase {
func testExample() throws {
print("Test: testExample")
// This is an example of a functional test case.
let base = "asdfghjkl123"
XCTAssert(base == "asdfghjkl123")
}
}
Next to the ..
func testExample() throws {
.. Xcode provides a nice little 'start single test'-button.
I used to klick it to start the test, locally (Xcode IDE on mac).
This used to work properly.
Klicking the 'start single test'-button, an overlay appears:
For the sake of this question to be machine-readable:
There is no scheme and/or test plan that contains every test you are trying to run. Create a new scheme and/or test plan containing the tests you want to run.
To close the overlay an 'OK'-Button is delivered only.
Just before there was no such scheme needed. I wonder why would that changes 'suddenly'.
From my point ov view Scheme/Testplans are executed 'on startup' of the device-emulator (or likewise), which is not my objective in the first place.
However - creating a TestPlan via:
File > New > File... > TestPlan
Adding the SDKTestAppSwiftTests-class using the +-Button.
... no success ... :-/
It seems my system is not the only one facing likewise issues.
No matter if there is a 'test-plan' and whatever name I assigned it - this is no solution.
I seriously do not know how to create a 'default test plan' if it was not the way decribed before.
Something about files with old configurations which have to be deleted
In this case I am not sure which file and where to find it exactly.
Even though one of the obove may help you, for me the issue is not solved, yet.
Thanks for reading & sharing - any help is appreciated :)
Upvotes: 6
Views: 6355
Reputation: 515
There is another solution ...
Upvotes: 2
Reputation: 264
For me I fixed this through my scheme → Edit Scheme → Test → Plus Sign (Add Test Target) and then adding my unit test target.
Upvotes: 6