www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - covered - processes output of code coverage analysis performed by the

reply Anton Fediushin <fediushin.anton yandex.ru> writes:
Hello! I am glad to announce a new command-line tool which should 
make development
  a little easier.

Program, compiled with `-cov` switch, generates *.lst files. They 
contain program source, number of executions of each line and 
total code coverage of the file.
Those files are quite useful for small programs/libraries, but 
not that useful for big ones.

Covered processes *.lst files, and reports only useful 
information. Behaviour can be changed with command-line options:

   '--coverage' reports code coverage in % for each file.
   '--blame' shows list of files ordered by code coverage.
   '--average' reports average code coverage for files.

Covered works for lists of files and directories, so '--blame' 
can be used to find less covered files, and '--average' to 
compute average code coverage of the project.

More documentation is available on project page on GitHub: 
https://github.com/ohdatboi/covered
It is also added to DUB package registry: 
http://code.dlang.org/packages/covered

Also, I am looking for huge projects, so I can test covered on 
them. Reply here or start an issue on GitHub if you know one.
Jul 31 2017
parent reply jmh530 <john.michael.hall gmail.com> writes:
On Monday, 31 July 2017 at 13:06:44 UTC, Anton Fediushin wrote:
 Hello! I am glad to announce a new command-line tool which 
 should make development
  a little easier.
You could add a mixin template that injects the "version(D_Coverage)" code.
Jul 31 2017
parent reply Anton Fediushin <fediushin.anton yandex.ru> writes:
On Monday, 31 July 2017 at 15:27:42 UTC, jmh530 wrote:
 On Monday, 31 July 2017 at 13:06:44 UTC, Anton Fediushin wrote:
 Hello! I am glad to announce a new command-line tool which 
 should make development
  a little easier.
You could add a mixin template that injects the "version(D_Coverage)" code.
Covered is a standalone tool, not intended to be used as a library. I don't think that forcing user to add it as dependency is a good idea, as well as messing with user's code (It is possible that `dmd_coverDestPath` is already overrided).
Jul 31 2017
parent reply Szabo Bogdan <szabobogdan yahoo.com> writes:
On Monday, 31 July 2017 at 15:45:18 UTC, Anton Fediushin wrote:
 On Monday, 31 July 2017 at 15:27:42 UTC, jmh530 wrote:
 On Monday, 31 July 2017 at 13:06:44 UTC, Anton Fediushin wrote:
 Hello! I am glad to announce a new command-line tool which 
 should make development
  a little easier.
You could add a mixin template that injects the "version(D_Coverage)" code.
Covered is a standalone tool, not intended to be used as a library. I don't think that forcing user to add it as dependency is a good idea, as well as messing with user's code (It is possible that `dmd_coverDestPath` is already overrided).
Nice work! I would like to contribute to such a tool :) I was working at something similar with trial( http://trial.szabobogdan.com/ ), and I would like to include your library if it's possible. this is a sample code coverage report: http://trial.szabobogdan.com/artifacts/coverage/html/index.html
Aug 01 2017
parent reply Anton Fediushin <fediushin.anton yandex.ru> writes:
On Tuesday, 1 August 2017 at 08:19:47 UTC, Szabo Bogdan wrote:
 Nice work!

 I would like to contribute to such a tool :) I was working at 
 something similar with trial( http://trial.szabobogdan.com/ ), 
 and I would like to include your library if it's possible.
Thanks! Yes, module "covered.loader" can be used, but it isn't complete yet. I'll start working on v1.0.0 tomorrow, changing current design (get as much information as possible and store it) to a new one (get only required information). This will increase speed and decrease memory usage.
 this is a sample code coverage report:
 http://trial.szabobogdan.com/artifacts/coverage/html/index.html
Nice! I'm using unit-threaded, but trial looks even better. I'll try it tomorrow.
Aug 01 2017
parent Anton Fediushin <fediushin.anton yandex.ru> writes:
On Tuesday, 1 August 2017 at 20:37:16 UTC, Anton Fediushin wrote:
 Thanks! Yes, module "covered.loader" can be used, but it isn't 
 complete yet. I'll start working on v1.0.0 tomorrow, changing 
 current design (get as much information as possible and store 
 it) to a new one (get only required information). This will 
 increase speed and decrease memory usage.
v1.0.0-alpha.1 is released. I'll release v1.0.0 as soon as I add some documentation, but I won't change API again, so it is ready to be used as a library. Also, I've done some benchmarks: https://github.com/ohdatboi/covered/releases/tag/v1.0.0-alpha.1
Aug 02 2017