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

Daniel Vollmer lists at maven.de
Fri Jan 8 07:49:41 CST 2016


Hello,

only as an additional data-point and without me having read the proposal very deeply

> On 8 Jan 2016, at 06:26, Paul Cantrell via swift-evolution <swift-evolution at swift.org> wrote:

[snip]

> These details I have questions or reservations about:
> 
> 	• lack of clarity about how to run individual test modules from the command line,
> 	• lack of clarity about which test modules are run by default with “swift test” (“all of them” is probably the wrong answer),
> 	• lack of clarity about how test modules interact with Package.swift, and related to that, how a project should specify build configuration and dependencies specific to a particular test module,
> 	• the “swift build --test” syntax (although I realize that this initial approach is due to larger constraints), and
> 	• a seeming assumption that extra compilation is essentially free.

I have next to no experience with Swift, but for a (heavily template-based… :/) C++ code, the compilation time of the unit tests is an order of magnitude longer than the compilation time of the actual code / library itself.
I would advise only compiling the tests when they are actually used (run).

For said C++ code we use waf (https://waf.io) as build-tool and our default build (triggered by `./waf`) only builds the library itself, while `./waf test` performs the normal build and in addition compiles and runs the tests (including correct dependency checking so that only those tests that need to be recompiled or rerun due to changes in the library itself do so). This later command then has options for forcing running of all or no tests.
This seems to work quite well for us in that context.

	Daniel.



More information about the swift-evolution mailing list