Quick: `swift test` doesn't actually run tests on macOS
- I have read CONTRIBUTING and have done my best to follow them.
What did you do?
- Created a simple Spec:
import Quick
import Nimble
class ThingsSpec: QuickSpec {
override func spec() {
describe("test") {
it("does the thing") {
expect(true).to(beTrue())
}
}
}
}
- Ran
swift test
What did you expect to happen?
I expected it to properly run the test spec, and output the results.
What actually happened instead?
Instead, I got the following output:
Test Suite 'All tests' started at 2017-01-14 00:03:05.037
Test Suite '[REDACTED]PackageTests.xctest' started at 2017-01-14 00:03:05.038
Test Suite '[REDACTED]PackageTests.xctest' passed at 2017-01-14 00:03:05.038.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'All tests' passed at 2017-01-14 00:03:05.038.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
Environment
List the software versions you’re using:
- Quick: 1.0.0
- Nimble: 5.1.1
- Xcode Version: Irrelevant
- Swift Version: Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
- Swift Package Manager 3.0.2 (swiftpm-11750)
Project that demonstrates the issue
I can’t link directly to the project in question, as it is closed source, but I had the same problem when attempting to verify the issue with ReactiveCocoa/ReactiveSwift .
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (11 by maintainers)
I try to explain…
QuickSpecmust be defined in Objective-C.NSInvocationrelated APIs ofXCTestCasein XCTest on macOS, butNSInvocationcannot be used from Swift. This is also the reason why we use Objective-C.LinuxMain.swiftentry point ,testCaseandXCTMainAPIs. Thanks to those, we can defineQuickSpecin Swift and can run examples without any use ofNSInvocations.swift teston macOS runs using ObjCXCTestso we must provide examples of a spec throughNSInvocationss and that can’t be achieved. There is noLinuxMain.swift,testCaseandXCTMainAPIs in ObjCXCTest.I’ll take another look at #600 and this issue, and in the next 2-3 days try to write up exactly what would need to be done, in either Quick or in SwiftPM, in order to allow users to successfully run
swift test.This can’t be done cleanly yet, but could you have an Obj-C implementation target which:
A question on this came up in SwiftPM Slack discussion today… is this something blocked on Quick or blocked on SwiftPM? It isn’t clear to me from the discussion here…