Skip to content

Commit 3b97f70

Browse files
committed
make the test suite pass when used with CMake
We somehow had managed to build XCTest with CMake but were running the test suite with build_script.py. Update the CMake based test suite setup. This is needed with the Foundation switch to CMake.
1 parent 82cb992 commit 3b97f70

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ add_custom_target(check-xctest
123123
FOUNDATION_BUILT_PRODUCTS_DIR=${XCTEST_PATH_TO_FOUNDATION_BUILD}
124124
LIBDISPATCH_SRC_DIR=${XCTEST_PATH_TO_LIBDISPATCH_SOURCE}
125125
LIBDISPATCH_BUILD_DIR=${XCTEST_PATH_TO_LIBDISPATCH_BUILD}
126-
LIBDISPATCH_OVERLAY_DIR=${XCTEST_PATH_TO_LIBDISPATCH_BUILD}/swift
126+
LIBDISPATCH_OVERLAY_DIR=${XCTEST_PATH_TO_LIBDISPATCH_BUILD}/src/swift
127127
SWIFT_EXEC=${CMAKE_SWIFT_COMPILER}
128128
${LIT_COMMAND} -sv ${CMAKE_SOURCE_DIR}/Tests/Functional
129129
COMMENT

Tests/Functional/lit.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ else:
7979
'-I', foundation_dir,
8080
'-I', os.path.join(foundation_dir, 'swift'),
8181
'-I', core_foundation_dir,
82-
'-F', os.path.join(core_foundation_dir, 'System', 'Library', 'Frameworks'),
82+
'-Xcc', '-F', '-Xcc', os.path.join(core_foundation_dir, 'System', 'Library', 'Frameworks'),
8383
])
84-
config.environment['LD_LIBRARY_PATH'] = foundation_dir
84+
8585
# We also need to link swift-corelibs-libdispatch, if
8686
# swift-corelibs-foundation is using it.
8787
libdispatch_src_dir = os.getenv('LIBDISPATCH_SRC_DIR')
@@ -98,6 +98,8 @@ else:
9898
'-L', os.path.join(libdispatch_build_dir, 'src'),
9999
])
100100

101+
config.environment['LD_LIBRARY_PATH'] = "{}:{}/src:{}".format(libdispatch_build_dir, libdispatch_build_dir, foundation_dir)
102+
101103
# Having prepared the swiftc command, we set the substitution.
102104
config.substitutions.append(('%{swiftc}', ' '.join(swift_exec)))
103105

0 commit comments

Comments
 (0)