I have a bug when I try to build a swift package on linux :
> swift build -v
lsb_release -r
which clang
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/4 -lPackageDescription -swift-version 4 -I /opt/swift/usr/lib/swift/pm/4 -sdk / /home/me/SwiftProject/Package.swift -fileno 5
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/3 -lPackageDescription -swift-version 3 -I /opt/swift/usr/lib/swift/pm/3 -sdk / /home/me/SwiftProject/.build/checkouts/siesta-3156441904511450749/Package.swift -fileno 5
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/3 -lPackageDescription -swift-version 3 -I /opt/swift/usr/lib/swift/pm/3 -sdk / /home/me/SwiftProject/.build/checkouts/SwiftyJSON-6376406316629445150/Package.swift -fileno 5
error: missingLinuxMain
I have no error when I run the last command:
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/3 -lPackageDescription -swift-version 3 -I /opt/swift/usr/lib/swift/pm/3 -sdk / /home/me/SwiftProject/.build/checkouts/SwiftyJSON-6376406316629445150/Package.swift -fileno 5
I have a file LinuxMain.swift in the Test directory:
Tests
├── ProjectTests
│ ├── SomeTests.swift
└── LinuxMain.swift
LinuxMain.swift:
import XCTest
@testable import ProjectTests
XCTMain([
testCase(SomeTests.allTests),
])
I use swift 4.0 on ubuntu 17.04