Skip to content

Commit e0b5aed

Browse files
committed
Merge pull request #227 from aciidb0mb3r/args_xctest_linux
Pass args to XCTest on linux
2 parents 2c588fd + ffc78eb commit e0b5aed

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Sources/swift-test/test.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@ func test(path: String..., xctestArg: String? = nil) throws -> Bool {
2222
if let xctestArg = xctestArg {
2323
args += ["-XCTest", xctestArg]
2424
}
25+
args += [testsPath]
2526
#else
26-
//FIXME: Pass xctestArg when swift-corelibs-xctest supports it
2727
testsPath = Path.join(path, "test-Package")
28+
args += [testsPath]
29+
if let xctestArg = xctestArg {
30+
args += [xctestArg]
31+
}
2832
#endif
2933

3034
guard testsPath.testExecutableExists else {
3135
throw Error.TestsExecutableNotFound
3236
}
3337

34-
args += [testsPath]
35-
3638
let result: Void? = try? system(args)
3739
return result != nil
3840
}

Sources/swift-test/usage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ func usage(print: (String) -> Void = { print($0) }) {
2323

2424
enum Mode {
2525
case Usage
26-
case Run(String)
26+
case Run(String?)
2727
}
2828

2929
func parse(commandLineArguments args: [String]) throws -> Mode {
3030

3131
if args.count == 0 {
32-
return .Run("All")
32+
return .Run(nil)
3333
}
3434

3535
guard let argument = args.first where args.count == 1 else {

0 commit comments

Comments
 (0)