Skip to content

Instantly share code, notes, and snippets.



Last active Feb 3, 2018
What would you like to do?
# It's relatively easy to run Apple XCTest on OS X and swift-corelibs-xctest on Linux.
# Just look at apple/swift-corelibs-foundation for an example.
# But it's pretty difficult to run swift-corelibs-xctest on OS X.
# Let's say we have the following file:
# // main.swift
# import XCTest
# XCTMain([])
# To compile this on Linux:
swiftc main.swift -o MyTest
# And to run:
# To compile this on OS X:
export BUILT_PRODUCTS_DIR=/Users/bgesiak/Library/Developer/Xcode/DerivedData/XCTest-bzxmivvccdrmtvctkfgutfkgbsze/Build/Products/Debug
xcrun -sdk `xcrun --sdk macosx --show-sdk-path` \
swiftc \
-target x86_64-apple-macosx10.11 \
-Xlinker -rpath \
main.swift -o MyTest
# And to run:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment