From 9ded1c74d8694347c49ebee2dd1afe4098b042c4 Mon Sep 17 00:00:00 2001 From: Rahul Katariya Date: Sat, 13 Apr 2019 16:06:25 +0530 Subject: [PATCH] Add Support For Linux --- .travis.yml | 13 +++++++++++++ Sources/Task.swift | 2 ++ Tests/LinuxMain.swift | 7 +++++++ 3 files changed, 22 insertions(+) create mode 100644 Tests/LinuxMain.swift diff --git a/.travis.yml b/.travis.yml index 67b1b5b..629e8ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,19 @@ matrix: git: submodules: false env: JOB=SWIFTPM_DARWIN + - sudo: required + dist: trusty + os: linux + language: generic + before_install: + - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)" + script: + - swift --version + - swift build + - swift test + git: + submodules: false + env: JOB=SWIFTPM - os: osx osx_image: xcode10.1 script: diff --git a/Sources/Task.swift b/Sources/Task.swift index 685d5d6..25dae5a 100644 --- a/Sources/Task.swift +++ b/Sources/Task.swift @@ -406,12 +406,14 @@ extension Task { process.arguments = self.arguments if shouldBeTerminatedOnParentExit { + #if os(macOS) // This is for terminating subprocesses when the parent process exits. // See https://github.com/Carthage/ReactiveTask/issues/3 for the details. let selector = Selector(("setStartsNewProcessGroup:")) if process.responds(to: selector) { process.perform(selector, with: false as NSNumber) } + #endif } if let cwd = self.workingDirectoryPath { diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..8425149 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest +@testable import ReactiveTaskTests + +Quick.QCKMain([ + StringExtensionSpec.self, + TaskSpec.self, +])