[swift-corelibs-dev] Add support for gathering test coverage data on XCTest

Jacopo Andrea Giola swift-corelibs-dev at jacopo.giola.org
Wed Dec 14 15:16:56 CST 2016


Hi all,

I was wondering if it can be a great idea to build the capability of gathering test coverage data inside the XCTest framework to be able to use it for gathering the data on the various platform without having to relay on the Xcode capability.

Today the only way a swift project can be gather coverage data during its ci build is to relay on building at least for the macOS platform, and only in that case, generate the xcproj file, running the tests with xcbuild, and after that we can have data to look at.

I’m trying to find on GitHub some swift project that has integrated a ci flow, and all the one that at the end wants to have the tests coverage data use this flow, on linux they use the swift cli commands for building and testing the project, and on macOS they use Xcode to gathering the data. Having two different flow for me is kinda crazy, and more crazy is to relay on the fact that if the tests coverage on macOS is 100% it will be even on Linux (or any other platform that Swift will support in the future) counting that in the code there can be different path used based on the platform.

Asking on the SwiftPM Slack channel, they point me on this list and here I am, it can be done? There is interest in this from the community?
The top will be that the swift test command will automatically generate the coverage data, and we can then pass it some kind of flag for choosing between two or three different output (like JSON, XML or what is the main file format this day to integrate nicely with things around the web and using services like codecov.io <http://codecov.io/>).

- Jacopo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20161214/c3130b48/attachment.html>


More information about the swift-corelibs-dev mailing list