Last active
February 3, 2018 23:00
-
-
Save modocache/853f5e9b3c00b1b4448c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
./MyTest | |
# 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 \ | |
-L$BUILT_PRODUCTS_DIR \ | |
-I$BUILT_PRODUCTS_DIR \ | |
-F$BUILT_PRODUCTS_DIR \ | |
-Xlinker -rpath \ | |
-Xlinker $BUILT_PRODUCTS_DIR \ | |
main.swift -o MyTest | |
# And to run: | |
./MyTest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment