Configuration
Configuration copied to clipboard
Move TestProgram into XCT Tests
TestProgram
was written to test code that has no easy way to be tested inside XCT test cases (i.e. code that parses env var and argv). We should revisit this issue and see if there is any way to test those code in XCT without having to build a separate executable.
Unable to setenv
in Swift code on Linux: https://bugs.swift.org/browse/SR-5076
Moving command-line argv test to XCTest should be possible as CommandLine.arguments
is a mutable array. ProcessInfo.processInfo.environment
is a get
-only dictionary so I'm unable to inject env var to it directly.
Problem should be solved in Package.swift
with the new SPM in Swift 4:
https://swift.org/blog/swift-package-manager-manifest-api-redesign/
Declare all regular and test targets.
All targets and their dependencies should be explicitly declared. If there are two targets, Foo and FooTests, declare both of them in targets label.
+1 on this. My applications all end up with a separate TestProgram
target.