You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm maintainer of Nimble, a framework that provides an alternative assertion DSL for Swift and Objective-C. Earlier today, I noticed that Nimble's integration with XCTest on Linux & Windows is lacking, which is entirely because there isn't a good place for Nimble to register its XCTestObservation conformer - which is how Nimble currently keeps track of the current test case - in a non-objc environment. On Darwin platforms, Nimble registers its XCTestObservation conformer when it's loaded, but that only works when the objc runtime is available.
Naively, I would think that making XCTCurrentTestCase publicly readable would solve this issue for Nimble, such as this patch:
diff --git a/Sources/XCTest/Public/XCTestCase.swift b/Sources/XCTest/Public/XCTestCase.swift
index 2d899b9..6e229fe 100644
--- a/Sources/XCTest/Public/XCTestCase.swift+++ b/Sources/XCTest/Public/XCTestCase.swift@@ -25,7 +25,7 @@ public typealias XCTestCaseEntry = (testCaseClass: XCTestCase.Type, allTests: [(
// A global pointer to the currently running test case. This is required in
// order for XCTAssert functions to report failures.
-internal var XCTCurrentTestCase: XCTestCase?+public private(set) var XCTCurrentTestCase: XCTestCase?
/// An instance of this class represents an individual test case which can be
/// run by the framework. This class is normally subclassed and extended with
Which would work, but I'm curious if that's actually the right approach that should be used here. There's probably a very good reason you haven't made XCTCurrentTestCase publicly readable, after all.
The text was updated successfully, but these errors were encountered:
Would you mind also filing feedback against Apple's XCTest implementation and let us know the FB number here? To add API for this to corelibs-xctest, we generally would want to add it to XCTest.framework first. (Mmm, bureaucracy.)
Hello!
I'm maintainer of Nimble, a framework that provides an alternative assertion DSL for Swift and Objective-C. Earlier today, I noticed that Nimble's integration with XCTest on Linux & Windows is lacking, which is entirely because there isn't a good place for Nimble to register its
XCTestObservation
conformer - which is how Nimble currently keeps track of the current test case - in a non-objc environment. On Darwin platforms, Nimble registers itsXCTestObservation
conformer when it's loaded, but that only works when the objc runtime is available.Naively, I would think that making
XCTCurrentTestCase
publicly readable would solve this issue for Nimble, such as this patch:Which would work, but I'm curious if that's actually the right approach that should be used here. There's probably a very good reason you haven't made
XCTCurrentTestCase
publicly readable, after all.The text was updated successfully, but these errors were encountered: