Skip to content

Commit 6091963

Browse files
committed
Set NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT when ENABLE_TESTING is set.
- Disable TestThread.test_threadName() as some of the tests are currently broken. - Disable NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT on Windows as it exposes more broken tests at the moment.
1 parent 326c78f commit 6091963

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

TestFoundation/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ target_link_libraries(TestFoundation PRIVATE
116116
target_link_libraries(TestFoundation PRIVATE
117117
XCTest)
118118

119+
# TODO: When all the normal tests run on Windows remove this gate to fix some more
120+
if(ENABLE_TESTING AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
121+
target_compile_definitions(TestFoundation PRIVATE
122+
NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT)
123+
endif()
124+
119125
# NOTE(compnerd) create a test "app" directory as we need the xdgTestHelper as
120126
# an executable peer and the binary will be placed in the directory with the
121127
# same name as a peer in the build tree.

TestFoundation/TestObjCRuntime.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TestObjCRuntime: XCTestCase {
6464
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
6565
func testClassesRenamedByAPINotes() throws {
6666
for entry in _NSClassesRenamedByObjCAPINotes {
67-
XCTAssert(NSClassFromString(NSStringFromClass(entry.class)) === entry.class)
67+
XCTAssert(try XCTUnwrap(NSClassFromString(NSStringFromClass(entry.class))) === entry.class)
6868
XCTAssert(NSStringFromClass(try XCTUnwrap(NSClassFromString(entry.objCName))) == entry.objCName)
6969
}
7070
}

TestFoundation/TestThread.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TestThread : XCTestCase {
3131
("test_sleepUntilDate", test_sleepUntilDate),
3232
]
3333

34-
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT
34+
#if NS_FOUNDATION_ALLOWS_TESTABLE_IMPORT && false // Disable for now as some tests are broken
3535
tests.append(contentsOf: [
3636
("test_threadName", test_threadName),
3737
])

0 commit comments

Comments
 (0)