I'm new to Swift development, just got the Xcode 7 beta 5 last week, and I don't understand what the Tests and UITests auto-created build targets are about, all I know is they always fail in runtime.
Question(s):
- Is this to be expected?
- Is there something I really need to worry about and/or fix?
- Will this affect my eligibility for App Store distribution?
(I'd noticed that these Products were always in red for the app I've started working on, so I tried pressing Command-U to build them, and in the middle of the simulator run, it failed with an ancaught exception. ...Ok, well, I'd moved some things around and perhaps that broke something.)
I just now created a fresh new project in Swift and selected single-view application, and tried to build this "blank" app for testing. Same thing happens:
It crashes at the call to XCUIApplication().launch() on line 21 of the ProjectNameUITests.swift file.
The crash log is as follows....
2015-08-21 17:25:53.355 XCTRunner[23578:764977] Running tests... 2015-08-21 17:25:53.356 XCTRunner[23578:764977] Looking for test bundles in /Users/myusername/Library/Developer/CoreSimulator/Devices/E4AD0BED-5385-4101-896D-961ADDD81217/data/Containers/Bundle/Application/405DDB28-80C8-40EB-8A82-716F140FD13C/ProjectNameUITests-Runner.app/PlugIns 2015-08-21 17:25:53.356 XCTRunner[23578:764977] Found test bundle at /Users/myusername/Library/Developer/CoreSimulator/Devices/E4AD0BED-5385-4101-896D-961ADDD81217/data/Containers/Bundle/Application/405DDB28-80C8-40EB-8A82-716F140FD13C/ProjectNameUITests-Runner.app/PlugIns/ProjectNameUITests.xctest 2015-08-21 17:25:53.357 XCTRunner[23578:764977] Looking for configurations in /Users/myusername/Library/Developer/CoreSimulator/Devices/E4AD0BED-5385-4101-896D-961ADDD81217/data/Containers/Bundle/Application/405DDB28-80C8-40EB-8A82-716F140FD13C/ProjectNameUITests-Runner.app/PlugIns/ProjectNameUITests.xctest 2015-08-21 17:25:53.375 XCTRunner[23578:764977] Found configuration <XCTestConfiguration: 0x7fcf94913130> testBundleURL:file:///Users/myusername/Library/Developer/Xcode/DerivedData/ProjectName-dwclcbyapxiiksauaxkvomftkqug/Build/Products/Debug-iphonesimulator/ProjectNameUITests-Runner.app/PlugIns/ProjectNameUITests.xctest productModuleName:ProjectNameUITests testsToSkip:(null) testsToRun:(null) reportResultsToIDE:YES sessionIdentifier:<__NSConcreteUUID 0x7fcf9490ef30> 99C63FB1-6ACF-4226-822D-9856B34B6638 pathToXcodeReportingSocket:(null) disablePerformanceMetrics:no treatMissingBaselinesAsFailures:no baselineFileURL:(null) targetApplicationPath:/Users/myusername/Library/Developer/Xcode/DerivedData/ProjectName-dwclcbyapxiiksauaxkvomftkqug/Build/Products/Debug-iphonesimulator/ProjectName.app targetApplicationBundleID:com.mycompany.com.ProjectName reportActivities:no Test Suite 'All tests' started at 2015-08-21 17:25:53.901 Test Suite 'ProjectNameUITests.xctest' started at 2015-08-21 17:25:53.902 Test Suite 'ProjectNameUITests' started at 2015-08-21 17:25:53.903 Test Case '-[ProjectNameUITests.ProjectNameUITests testExample]' started. t = 0.00s Start Test t = 0.00s Set Up t = 0.03s Launch com.mycompany.com.ProjectName t = 2.70s Assertion Failure: UI Testing Failure - Failed to receive completion for <XCDeviceEvent:0x7fcf92c09320 page 12 usage 64 duration 0.01s within 2.5s /Users/myusername/exercises/iOS/ProjectName/ProjectNameUITests/ProjectNameUITests.swift:21: error: -[ProjectNameUITests.ProjectNameUITests testExample] : UI Testing Failure - Failed to receive completion for <XCDeviceEvent:0x7fcf92c09320 page 12 usage 64 duration 0.01s within 2.5s 2015-08-21 17:25:56.636 XCTRunner[23578:764977] *** Terminating app due to uncaught exception '_XCTestCaseInterruptionException', reason: 'Interrupting test' *** First throw call stack: ( 0 CoreFoundation 0x000000010c5049b5 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010bf7cdeb objc_exception_throw + 48 2 CoreFoundation 0x000000010c5048ed +[NSException raise:format:] + 205 3 XCTest 0x000000010ba44b4d -[XCTestCase _dequeueFailures] + 560 4 XCTest 0x000000010ba44e29 -[XCTestCase _enqueueFailureWithDescription:inFile:atLine:expected:] + 576 5 XCTest 0x000000010ba4c5b8 _XCTFailureHandler + 1112 6 XCTest 0x000000010ba43fcd _XCTFailInCurrentTest + 512 7 XCTest 0x000000010ba60da3 -[XCUIDevice _dispatchEventWithPage:usage:duration:] + 790 8 XCTest 0x000000010ba52a35 -[XCAXClient_iOS init] + 94 9 XCTest 0x000000010ba529ce __30+[XCAXClient_iOS sharedClient]_block_invoke + 24 10 libdispatch.dylib 0x000000010e73e4c7 _dispatch_client_callout + 8 11 libdispatch.dylib 0x000000010e72bd2f dispatch_once_f + 76 12 XCTest 0x000000010ba529b4 +[XCAXClient_iOS sharedClient] + 42 13 XCTest 0x000000010ba622f9 __37-[XCUIApplication _launchUsingXcode:]_block_invoke + 50 14 XCTest 0x000000010ba486c7 -[XCTestCase startActivityWithTitle:block:] + 305 15 XCTest 0x000000010ba622b8 -[XCUIApplication _launchUsingXcode:] + 309 16 ProjectNameUITests 0x00000001188ef809 _TFC16ProjectNameUITests16ProjectNameUITests5setUpfS0_FT_T_ + 153 17 ProjectNameUITests 0x00000001188ef892 _TToFC16ProjectNameUITests16ProjectNameUITests5setUpfS0_FT_T_ + 34 18 XCTest 0x000000010ba486c7 -[XCTestCase startActivityWithTitle:block:] + 305 19 XCTest 0x000000010ba45083 __24-[XCTestCase invokeTest]_block_invoke_2 + 118 20 XCTest 0x000000010ba72824 -[XCTestContext performInScope:] + 184 21 XCTest 0x000000010ba44ffc -[XCTestCase invokeTest] + 169 22 XCTest 0x000000010ba45497 -[XCTestCase performTest:] + 443 23 XCTest 0x000000010ba4315d -[XCTestSuite performTest:] + 377 24 XCTest 0x000000010ba4315d -[XCTestSuite performTest:] + 377 25 XCTest 0x000000010ba4315d -[XCTestSuite performTest:] + 377 26 XCTest 0x000000010ba3098d __25-[XCTestDriver _runSuite]_block_invoke + 51 27 XCTest 0x000000010ba50b53 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 615 28 XCTest 0x000000010ba308d9 -[XCTestDriver _runSuite] + 408 29 XCTest 0x000000010ba31638 -[XCTestDriver _checkForTestManager] + 263 30 XCTest 0x000000010ba73b4e _XCTestMain + 628 31 libdispatch.dylib 0x000000010e722ea9 _dispatch_call_block_and_release + 12 32 libdispatch.dylib 0x000000010e73e4c7 _dispatch_client_callout + 8 33 libdispatch.dylib 0x000000010e72907d _dispatch_main_queue_callback_4CF + 714 34 CoreFoundation 0x000000010c464e69 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 35 CoreFoundation 0x000000010c4263b9 __CFRunLoopRun + 2073 36 CoreFoundation 0x000000010c425918 CFRunLoopRunSpecific + 488 37 GraphicsServices 0x000000010df68ad2 GSEventRunModal + 161 38 UIKit 0x000000010c8b299e UIApplicationMain + 171 39 XCTRunner 0x000000010b9bb6bf XCTRunner + 5823 40 libdyld.dylib 0x000000010e76e92d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type _XCTestCaseInterruptionException (lldb)
...and the two Products are still shown in red on the left.
So...this is over my head given my beginner status. I'm not sure what I'm doing wrong, I'm working with the program "fresh out of the box" and not trying anything fancy.
Any feedback would be appreciated. Thanks