On Wednesday, 10 January 2018 at 05:35:05 UTC, Andre Pany wrote:
On Wednesday, 3 January 2018 at 17:43:36 UTC, Martin Nowak wrote:
Glad to announce D 2.078.0.

This release comes with runtime detection of Visual Studio installation paths, an integral promotion transition for unary operations on byte and short sized integers, more -betterC features, and a couple of language and library tweaks.

Thanks to everyone involved in this 👏 https://dlang.org/contributors.html.

http://downloads.dlang.org/releases/2.x/2.078.0/ http://dlang.org/changelog/2.078.0.html

- -Martin

What is the purpose of the coverage option "srcpath"?

In my scenario I have a folder "dependencies" and a folder "source". I want to generate
code coverage only for the files in folder "source".

dmd -unittest -cov source/app.d dependencies/dep.d
app.exe --DRT-covopt="srcpath:./source dstpath:./cov"

By specifying "srcpath" there are 2 empty files created in folder cov:

I thought by specifying "srcpath" I limit the code coverage generation to the files located in folder source...

From what I saw in the code, I think what it does is just override where the code was actually placed when you compiled, so tools to visualize the coverage can show you the source code.

* https://dlang.org/code_coverage.html#switchsrcpath
* https://github.com/dlang/druntime/blob/382b759738b5fa1e59bfda2ad542b9d60ef3d59a/src/rt/cover.d#L83-L84 * https://github.com/dlang/druntime/blob/382b759738b5fa1e59bfda2ad542b9d60ef3d59a/src/rt/cover.d#L211

BTW, to just report coverage of certain files you can just compile with `-cov` those files. I guess that should work (maybe? :).

Reply via email to