[swift-evolution] [Review] SE-0019 Swift Testing (Package Manager)

Rick Ballard rballard at apple.com
Thu Jan 21 14:54:38 CST 2016


Hi Paul,

> On Jan 19, 2016, at 7:35 PM, Paul Cantrell <cantrell at pobox.com> wrote:
> 
> This is important:
> 
>> This proposal also does not cover the need for utility code, ie. a module that is built for tests to consume that is provided as part of a package and is not desired to be an external package. This is something we would like to add as part of a future proposal.
> 
> 
> …and it makes me wonder whether multiple test files can share helper code within a single test module (crucial!), or whether every test file is compiled in isolation.

Test modules are like any other swift module and are not restricted to compiling a single file. So sharing helper code within a test module should be fine; the part we don't support right now is sharing one module of utility code among multiple separate test modules, unless you make that utility module a separate package.

> I’ll be interested in the future proposals that work out how test module options are specified in Package.swift.
> 
> I assume that all test modules are run by default with “swift test”? Again, I won’t repeat the more details concerns about that from the previous review, but just note that it should be possible for Package.swift to specify that some test modules don’t get run by default. I imagine this might be part of the proposal that establishes what “--kind=performance” means.

Our plan is that 'swift test' by default will run all the test modules in the top-level package, but will not by default run all test modules in depended-upon packages (though that will be possible). Adding the ability to remove test modules from the default set that we run would be a good future enhancement.

Thanks,

	- Rick


More information about the swift-evolution mailing list