Can't run test in newly-created Swift 4.3 package on Ubuntu 18.04


(Rick M) #1

I just installed Swift 4.3.2 on Ubuntu 18.04, and then did the following. Note at the end, when attempting to run the test, I get error: value of type 'Process' has no member 'run' (and the example test code seems to really favor macOS).

$ mkdir TestURLSession
$ cd TestURLSession
$ swift package init --type executable
Creating executable package: TestURLSession
Creating Package.swift
Creating README.md
Creating Sources/
Creating Sources/TestURLSession/main.swift
Creating Tests/
Creating Tests/LinuxMain.swift
Creating Tests/TestURLSessionTests/
Creating Tests/TestURLSessionTests/TestURLSessionTests.swift
Creating Tests/TestURLSessionTests/XCTestManifests.swift
$ swift run TestURLSession
Compile Swift Module 'TestURLSession' (1 sources)
Linking ./.build/x86_64-unknown-linux/debug/TestURLSession
Hello, world!
$ swift test
Compile Swift Module 'TestURLSessionTests' (2 sources)
/home/rmann/Projects/TestURLSession/Tests/TestURLSessionTests/TestURLSessionTests.swift:29:13: error: value of type 'Process' has no member 'run'
        try process.run()
            ^~~~~~~ ~~~
error: terminated(1): /home/rmann/swift/versions/swift-4.2.3-RELEASE-ubuntu18.04/usr/bin/swift-build-tool -f /home/rmann/Projects/TestURLSession/.build/debug.yaml test output: