[swift-users] XCTest on Linux

Mish Awadah mawadah at apple.com
Mon Dec 7 23:37:35 CST 2015


Don’t use “swift” unless you want to run the REPL. Here’s how you should build a package that runs tests: 

local at ubuntu:~/Documents$ mkdir XTest
local at ubuntu:~/Documents$ cd XTest/
local at ubuntu:~/Documents/XTest$ touch Package.swift
local at ubuntu:~/Documents/XTest$ emacs -nw main.swift
local at ubuntu:~/Documents/XTest$ swift build
Compiling Swift Module 'XTest' (1 sources)
Linking Executable:  .build/debug/XTest
local at ubuntu:~/Documents/XTest$ .build/debug/XTest
Total executed 0 tests, with 0 failures (0 unexpected) in -nan (0.0) seconds

- mish

> On Dec 7, 2015, at 9:26 PM, Stepan Hruda via swift-users <swift-users at swift.org> wrote:
> 
> I’m having a hard time linking against XCTest on Linux. The absolute minimal example: 
> 
> import XCTest
> XCTMain([])
> 
> being run through `swift main.swift` outputs "LLVM ERROR: Program used external function '_TF6XCTest7XCTMainFGSaPS_10XCTestCase__T_' which could not be resolved!”.
> 
> Could anyone nudge me in the right direction?
>  _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151207/8d3a9154/attachment.html>


More information about the swift-users mailing list