Skip to content

Commit be7bc79

Browse files
authored
Merge pull request #422 from seabaylea/dispatch-tests
Enable libdispatch usage in TestFoundation
2 parents bd66182 + de6b8fa commit be7bc79

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

build.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
# swift_cflags += ([
7878
# '-DDEPLOYMENT_ENABLE_LIBDISPATCH',
7979
# '-I'+Configuration.current.variables["LIBDISPATCH_SOURCE_DIR"],
80-
# '-I'+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+'/src'
80+
# '-I'+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+'/src',
81+
# '-Xcc -fblocks'
8182
# ])
8283
# foundation.LDFLAGS += '-ldispatch -L'+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+'/src/.libs -rpath \$$ORIGIN '
8384

@@ -429,6 +430,12 @@
429430

430431
script.add_product(foundation)
431432

433+
LIBS_DIRS = "LD_LIBRARY_PATH=${BUILD_DIR}/Foundation/"
434+
if "XCTEST_BUILD_DIR" in Configuration.current.variables:
435+
LIBS_DIRS += ":${XCTEST_BUILD_DIR}"
436+
if "LIBDISPATCH_BUILD_DIR" in Configuration.current.variables:
437+
LIBS_DIRS += ":"+Configuration.current.variables["LIBDISPATCH_BUILD_DIR"]+"/src/.libs"
438+
432439
extra_script = """
433440
rule InstallFoundation
434441
command = mkdir -p "${DSTROOT}/${PREFIX}/lib/swift/${OS}"; $
@@ -444,21 +451,9 @@
444451
build install: phony | ${BUILD_DIR}/.install
445452
446453
"""
447-
if "XCTEST_BUILD_DIR" in Configuration.current.variables:
448-
extra_script += """
449-
rule RunTestFoundation
450-
command = echo "**** RUNNING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/:${XCTEST_BUILD_DIR} ${BUILD_DIR}/TestFoundation/TestFoundation\\n**** DEBUGGING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/:${XCTEST_BUILD_DIR} lldb ${BUILD_DIR}/TestFoundation/TestFoundation\\n"
451-
description = Building Tests
452-
453-
build ${BUILD_DIR}/.test: RunTestFoundation | TestFoundation
454-
455-
build test: phony | ${BUILD_DIR}/.test
456-
457-
"""
458-
else:
459-
extra_script += """
454+
extra_script += """
460455
rule RunTestFoundation
461-
command = echo "**** RUNNING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/ ${BUILD_DIR}/TestFoundation/TestFoundation\\n**** DEBUGGING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${BUILD_DIR}/Foundation/ lldb ${BUILD_DIR}/TestFoundation/TestFoundation\\n"
456+
command = echo "**** RUNNING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${LIBS_DIRS} ${BUILD_DIR}/TestFoundation/TestFoundation\\n**** DEBUGGING TESTS ****\\nexecute:\\nLD_LIBRARY_PATH=${LIBS_DIRS} lldb ${BUILD_DIR}/TestFoundation/TestFoundation\\n"
462457
description = Building Tests
463458
464459
build ${BUILD_DIR}/.test: RunTestFoundation | TestFoundation

0 commit comments

Comments
 (0)