How to work with coverage data

2022-07-31 Thread Christian Köstlin via Digitalmars-d-learn
Hi dlang lovers, I recently wanted to improve how I work with coverage data (locally). For that I came up with a small program, that can be either called after a `dub test --coverage` or that can be automatically executed after the unittest with `postRunCommands "$DUB run lst2errormes

Re: does the format of coverage files have a name?

2022-07-28 Thread Paul Backus via Digitalmars-d-learn
On Monday, 25 July 2022 at 13:17:41 UTC, Moth wrote: or was the .lst extension chosen arbitrarily? my text editor [notepad++] thinks it's COBOL for some reason but that's obviously not correct, so i'm wondering if it has an official spec or anything. knowing the name of it would help - maybe

does the format of coverage files have a name?

2022-07-25 Thread Moth via Digitalmars-d-learn
or was the .lst extension chosen arbitrarily? my text editor [notepad++] thinks it's COBOL for some reason but that's obviously not correct, so i'm wondering if it has an official spec or anything. knowing the name of it would help - maybe my editor already has syntax highlighting for it.

Re: How to use dmd code coverage

2021-11-12 Thread Imperatorn via Digitalmars-d-learn
On Friday, 12 November 2021 at 22:27:48 UTC, forkit wrote: On Friday, 12 November 2021 at 19:32:31 UTC, Dr Machine Code wrote: On Thursday, 11 November 2021 at 23:51:42 UTC, foxit wrote: [...] is your IDE more of a REPL thing? It's a custom IDE for me, that I wrote using Winforms/C# (devel

Re: How to use dmd code coverage

2021-11-12 Thread forkit via Digitalmars-d-learn
On Friday, 12 November 2021 at 19:32:31 UTC, Dr Machine Code wrote: On Thursday, 11 November 2021 at 23:51:42 UTC, foxit wrote: On Thursday, 11 November 2021 at 22:35:21 UTC, forkit wrote: [...] Actually, the reason I got soo confused is clear to me now. I have my own GUI IDE, which I wr

Re: How to use dmd code coverage

2021-11-12 Thread Dr Machine Code via Digitalmars-d-learn
On Thursday, 11 November 2021 at 23:51:42 UTC, foxit wrote: On Thursday, 11 November 2021 at 22:35:21 UTC, forkit wrote: [...] Actually, the reason I got soo confused is clear to me now. I have my own GUI IDE, which I wrote myself (winforms/C#) cause I got so fed up with creating/saving

Re: How to use dmd code coverage

2021-11-11 Thread foxit via Digitalmars-d-learn
On Thursday, 11 November 2021 at 22:35:21 UTC, forkit wrote: On Thursday, 11 November 2021 at 21:40:33 UTC, Ali Çehreli wrote: On 11/11/21 1:37 PM, forkit wrote: dmd test.d -cov ...but no .lst file anywhere to be found. Huh! I don't get it. Please run the program! :) Ali oh! that kinda m

Re: How to use dmd code coverage

2021-11-11 Thread forkit via Digitalmars-d-learn
On Thursday, 11 November 2021 at 21:40:33 UTC, Ali Çehreli wrote: On 11/11/21 1:37 PM, forkit wrote: dmd test.d -cov ...but no .lst file anywhere to be found. Huh! I don't get it. Please run the program! :) Ali oh! that kinda makes sense, now that I think of it ;-)

Re: How to use dmd code coverage

2021-11-11 Thread Ali Çehreli via Digitalmars-d-learn
On 11/11/21 1:37 PM, forkit wrote: dmd test.d -cov ...but no .lst file anywhere to be found. Huh! I don't get it. Please run the program! :) Ali

How to use dmd code coverage

2021-11-11 Thread forkit via Digitalmars-d-learn
// -- module test; import std.stdio; void main() { writeln("Hello World!"); } // --- dmd test.d -cov ..but no .lst file anywhere to be found. Huh! I don't get it.

Code coverage exit code 1 on failure?

2021-09-30 Thread wjoe via Digitalmars-d-learn
What's the reasoning behind picking exit code 1 ? Makes it pretty much impossible to distinguish between a lack of coverage code 1 and a process code 1. Is there a handler where it can be overridden ?

Re: toString and code coverage...

2021-09-22 Thread wjoe via Digitalmars-d-learn
On Wednesday, 22 September 2021 at 18:59:11 UTC, user1234 wrote: [...] I'd use option 2. Thanks, I'll do just that :)

Re: toString and code coverage...

2021-09-22 Thread user1234 via Digitalmars-d-learn
On Wednesday, 22 September 2021 at 15:27:23 UTC, wjoe wrote: Is there a convenient way to exclude it from coverage ? Because adjusting the -cov=xx percentage is kind of annoying and may omit other things as well. Do you care and if yes how do you handle it ? You have several options 1

toString and code coverage...

2021-09-22 Thread wjoe via Digitalmars-d-learn
Is there a convenient way to exclude it from coverage ? Because adjusting the -cov=xx percentage is kind of annoying and may omit other things as well. Do you care and if yes how do you handle it ?

Re: Uploading coverage to Codecov doesn't work

2020-07-14 Thread Basile B. via Digitalmars-d-learn
://community.codecov.io/t/uploading-d-lang-coverage-doesnt-work/1740 So hopefully, someone will look at this. Bookmarked. Thanks much for taking the time to register on their forums, I didn't want to. Forgot to say. In my case I suspect that this is caused by a force push, like here

Re: Uploading coverage to Codecov doesn't work

2020-07-14 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 14 July 2020 at 11:05:17 UTC, Mitacha wrote: On Saturday, 11 July 2020 at 09:43:39 UTC, Basile B. wrote: On Wednesday, 8 July 2020 at 15:55:58 UTC, Mitacha wrote: I filed an issue on codecov community forum https://community.codecov.io/t/uploading-d-lang-coverage-doesnt-work/1740

Re: Uploading coverage to Codecov doesn't work

2020-07-14 Thread Mitacha via Digitalmars-d-learn
ing gcov in . (disable via -X gcov) ==> Python coveragepy not found ==> Searching for coverage reports in: + . --> No coverage report found. Please visit http://docs.codecov.io/docs/supported-languages --- That used to work perfectly. Note that it's broken for DMD test suite too. I

Re: Uploading coverage to Codecov doesn't work

2020-07-11 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 8 July 2020 at 15:55:58 UTC, Mitacha wrote: Hello there, I've been trying to setup bitbucket pipelines to submit coverage to codecov, but with no luck. I use `dub run -b unittest-cov` and it generates .lst files correctly, then `bash <(curl -s https://codecov.io/

Re: Uploading coverage to Codecov doesn't work

2020-07-08 Thread user1234 via Digitalmars-d-learn
On Wednesday, 8 July 2020 at 15:55:58 UTC, Mitacha wrote: Hello there, I've been trying to setup bitbucket pipelines to submit coverage to codecov, but with no luck. I use `dub run -b unittest-cov` and it generates .lst files correctly, then `bash <(curl -s https://codecov.io/

Uploading coverage to Codecov doesn't work

2020-07-08 Thread Mitacha via Digitalmars-d-learn
Hello there, I've been trying to setup bitbucket pipelines to submit coverage to codecov, but with no luck. I use `dub run -b unittest-cov` and it generates .lst files correctly, then `bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN` is called, but all I get is: ``` ==>

Re: Coverage (-cov)

2017-09-23 Thread Tony via Digitalmars-d-learn
On Sunday, 24 September 2017 at 05:48:32 UTC, Tony wrote: I am compiling a module (utils) with one function in it with the -cov compiler option on Ubuntu 14.04 with DMD v2.073.2. I then compile a "main module" with -cov that imports the "utils module" and calls the one function. The *.lst outpu

Coverage (-cov)

2017-09-23 Thread Tony via Digitalmars-d-learn
I am compiling a module (utils) with one function in it with the -cov compiler option on Ubuntu 14.04 with DMD v2.073.2. I then compile a "main module" with -cov that imports the "utils module" and calls the one function. The *.lst output file shows lines that executed in the "main module". I w

Getting the coverage data at runtime

2017-06-18 Thread Szabo Bogdan via Digitalmars-d-learn
Hi, I am wondering if there is any way of getting the code coverage at runtime... As a I seen in the runtime, the .lst files are created inside this module dealocator: https://github.com/dlang/druntime/blob/master/src/rt/cover.d#L152 and the `Cover[] gdata;` is private, so no way of

Re: Coverage

2016-02-16 Thread Chris Wright via Digitalmars-d-learn
;arg4"]); return 0; } else { return realMain(args); } } This only deals with one build configuration, though, which is why it's better to be able to combine coverage reports.

Re: Coverage

2016-02-16 Thread Leandro Motta Barros via Digitalmars-d-learn
I had one case these days in which I also had a lot of data to use in the test. I was able to put the data as very large regular D arrays, but this increased my compilation times a lot (not to mention the time to run the unit tests). I decided to enclose this specific unit test (including the `imp

Re: Coverage

2016-02-16 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Tuesday, 16 February 2016 at 12:35:38 UTC, Leandro Motta Barros wrote: You probably already though of it, but: can't you create a unittest that calls your code as many times as desired, passing different input each time? That is a viable option yes. I will probably end up doing it like tha

Re: Coverage

2016-02-16 Thread Leandro Motta Barros via Digitalmars-d-learn
currently run dmd's coverage on my unittests. > > But now I also want to execute my program with different inputs and then > merge all that coverage info from each run. > > Any chance there is something for that? >

Coverage

2016-02-16 Thread Sebastiaan Koppe via Digitalmars-d-learn
I currently run dmd's coverage on my unittests. But now I also want to execute my program with different inputs and then merge all that coverage info from each run. Any chance there is something for that?

Re: Measuring test coverage

2015-08-10 Thread Alexei Bykov via Digitalmars-d-learn
On Monday, 10 August 2015 at 04:03:36 UTC, Rikki Cattermole wrote: On 10/08/2015 8:24 a.m., Alexei Bykov wrote: D has builtin support for coverage analysis but it produces only .lst files. This is a bit inconvenient. Is there any tool which can create something like an html report from .lst

Re: Measuring test coverage

2015-08-10 Thread Alexei Bykov via Digitalmars-d-learn
On Monday, 10 August 2015 at 08:06:35 UTC, Stefan Frijters wrote: On Sunday, 9 August 2015 at 20:24:22 UTC, Alexei Bykov wrote: D has builtin support for coverage analysis but it produces only .lst files. This is a bit inconvenient. Is there any tool which can create something like an html

Re: Measuring test coverage

2015-08-10 Thread Stefan Frijters via Digitalmars-d-learn
On Sunday, 9 August 2015 at 20:24:22 UTC, Alexei Bykov wrote: D has builtin support for coverage analysis but it produces only .lst files. This is a bit inconvenient. Is there any tool which can create something like an html report from .lst files? For now I'm using OpenCppCoverage which i

Re: Measuring test coverage

2015-08-09 Thread Rikki Cattermole via Digitalmars-d-learn
On 10/08/2015 8:24 a.m., Alexei Bykov wrote: D has builtin support for coverage analysis but it produces only .lst files. This is a bit inconvenient. Is there any tool which can create something like an html report from .lst files? For now I'm using OpenCppCoverage which is not the best too

Measuring test coverage

2015-08-09 Thread Alexei Bykov via Digitalmars-d-learn
D has builtin support for coverage analysis but it produces only .lst files. This is a bit inconvenient. Is there any tool which can create something like an html report from .lst files? For now I'm using OpenCppCoverage which is not the best tool and works only on Windows but at lea

Re: Code Coverage Analysis, how do I skip (ignore) a line?

2015-07-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, July 22, 2015 02:19:52 antropod via Digitalmars-d-learn wrote: > I want my coverage analysis to be 100%, how do I skip lines like > assert(0); > from being counted? AFAIK, there is no way to so, and I've mentioned that problem to Walter before, so I would have e

Code Coverage Analysis, how do I skip (ignore) a line?

2015-07-21 Thread antropod via Digitalmars-d-learn
I want my coverage analysis to be 100%, how do I skip lines like assert(0); from being counted?

Code coverage during CTFE

2015-02-03 Thread Stefan Frijters via Digitalmars-d-learn
erate them. These functions are never called at runtime, and as such are shown with the nasty red bars for no coverage. Is it possible to get a -cov dump for code run at compile time? [1] https://github.com/ColdenCullen/doveralls

mangled coverage report

2014-06-07 Thread Alix Pexton via Digitalmars-d-learn
I've just noticed that in the .lst file for one of my libs the execution counts stop lining up with the source, and the source itself is truncated by a couple of lines. The function where the misalignment begins contains an "if (__ctfe)" block (first time I ever used one) but just testing that

Re: Problem with code coverage. No .lst files?

2014-04-26 Thread Jeremy DeHaan via Digitalmars-d-learn
On Sunday, 27 April 2014 at 00:37:39 UTC, Ali Çehreli wrote: So, under Linux, if I start the program as test/wont then the .lst gets generated in the current directory. Ali Just tried that in Windows, and the same thing happened. Weird! I'll be sure to file a bug report. Thanks for the confi

Re: Problem with code coverage. No .lst files?

2014-04-26 Thread Ali Çehreli via Digitalmars-d-learn
On 04/26/2014 01:11 PM, Jeremy DeHaan wrote: > If you compile with -cov > AND use -of where the output file is in a different directory than where > the build is taking place(eg, buld happens in C:/DProject/, and the > command line has -ofC:/DProject/Unittest/Unittest.exe), no .lst files > are pr

Re: Problem with code coverage. No .lst files?

2014-04-26 Thread Jeremy DeHaan via Digitalmars-d-learn
On Friday, 25 April 2014 at 08:20:37 UTC, Jeremy DeHaan wrote: On Friday, 25 April 2014 at 04:23:45 UTC, Ali Çehreli wrote: On 04/24/2014 08:32 PM, Jeremy DeHaan wrote: > added the -cov switch to my unit test build Then you must execute the program. :) Ali I did, but still nothing. I even t

Re: Problem with code coverage. No .lst files?

2014-04-25 Thread Jeremy DeHaan via Digitalmars-d-learn
On Friday, 25 April 2014 at 04:23:45 UTC, Ali Çehreli wrote: On 04/24/2014 08:32 PM, Jeremy DeHaan wrote: > added the -cov switch to my unit test build Then you must execute the program. :) Ali I did, but still nothing. I even tried using the switch in a debug build and the same thing happe

Re: Problem with code coverage. No .lst files?

2014-04-24 Thread Ali Çehreli via Digitalmars-d-learn
On 04/24/2014 08:32 PM, Jeremy DeHaan wrote: > added the -cov switch to my unit test build Then you must execute the program. :) Ali

Problem with code coverage. No .lst files?

2014-04-24 Thread Jeremy DeHaan via Digitalmars-d-learn
Hey all, I tried to use code coverage analysis for the first time tonight. I added the -cov switch to my unit test build, but no matter what I do, I can't seem to locate the produced .lst files. Is there something I should know that isn't in the docs that I might be doing wrong? I&

Re: How can I specify a location to write the code coverage files generated with '-cov'?

2014-04-04 Thread Saurabh Das
thname ); That is perfect! Many many thanks! Add these prototypes to your code and use them to override the default coverage paths. Saurabh

Re: How can I specify a location to write the code coverage files generated with '-cov'?

2014-04-04 Thread Daniel Murphy
verride the default coverage paths.

Re: How can I specify a location to write the code coverage files generated with '-cov'?

2014-04-03 Thread Ali Çehreli
On 04/03/2014 09:10 PM, Saurabh Das wrote: > Say I compile a program with: > > dmd -unittest -debug -cov test.d So, that's what the makefile generates. ;) You can have an additional line that moves the coverage file away. Ali

Re: How can I specify a location to write the code coverage files generated with '-cov'?

2014-04-03 Thread Saurabh Das
After reading some of the bug reports on BugZilla, I gather that this isn't possible yet :( Thanks, Saurabh On Friday, 4 April 2014 at 04:10:51 UTC, Saurabh Das wrote: Hello, Say I compile a program with: dmd -unittest -debug -cov test.d Then, when I run ./test, a file 'test.lst' is generat

How can I specify a location to write the code coverage files generated with '-cov'?

2014-04-03 Thread Saurabh Das
Hello, Say I compile a program with: dmd -unittest -debug -cov test.d Then, when I run ./test, a file 'test.lst' is generated in the current working directory. Is there a way in which I can instruct the file to be created in a separate './cov_log/' directory? Thanks, Saurabh

Re: compile time coverage: dmd -staticcov

2013-03-18 Thread bearophile
timotheecour: Why not have a -staticcov (or -ctcov) flag to dmd that produces compile time code coverage? This seems a note fit to be added to this: http://d.puremagic.com/issues/show_bug.cgi?id=9721 Bye, bearophile

compile time coverage: dmd -staticcov

2013-03-18 Thread timotheecour
Why not have a -staticcov (or -ctcov) flag to dmd that produces compile time code coverage? This will work for most code (with the exception of virtual methods called from a base class -- anything else?): it'll just produce 1 or 0 depending for each line compiled in, depending on whether