Swift 4 unit tests don't run in a mixed Objective-C/Swift codebase
Originator: | jp | ||
Number: | rdar://33514802 | Date Originated: | 25-Jul-2017 10:13 AM |
Status: | Open | Resolved: | |
Product: | Developer Tools | Product Version: | Xcode 9 beta 4 (9M189t) |
Classification: | Other Bug | Reproducible: | Always |
Summary: Realm’s Objective-C/Swift tests run fine with Xcode 9 beta 4 in Swift 3 mode, but the Swift tests don’t run in Swift 4 mode. Steps to Reproduce: 1. Open Realm.xcodeproj in Xcode 9 beta 4 from the attached archive 2. Select the “Realm” scheme 3. Run unit tests (cmd-U) 4. Observe that the unit tests from Swift sources do not run 5. Perform a `git reset —hard` command to revert the `SWIFT_VERSION` configuration setting to 3.0 6. Run unit tests again (cmd-U) 7. Observe that the unit tests from Swift sources now run Expected Results: For Swift unit test sources that compile and run in `SWIFT_VERSION=3.0` mode, they should also compile and run in `SWIFT_VERSION=4.0` mode, or in the case of a compilation error, should display that compilation error and abort the test process. Actual Results: Changing the SWIFT_VERSION mode from 3.0 to 4.0 just skips the Swift sources, neither compiling them nor running their unit tests. Version: Xcode 9 beta 4 (9M189t) Notes: Interestingly enough, Xcode’s test navigator pane does _detect_ the tests, but doesn’t compile them or run them. I’ve attached a video walking through the reproduction steps as well as an archive of the project.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Aug 9 2017
This is fixed in beta 5. Thanks!