unittest-cov - results?

Seb via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 5 11:09:46 PDT 2017


On Wednesday, 5 July 2017 at 17:46:01 UTC, Jolly James wrote:
> How does unit testing with dub work?
>
>> dub build --arch=x86_64 --build=unittest-cov --force 
>> --compiler=ldc2
>
> After execution, there is no result output in the command line.

For every file a `<file>.lst` file is generated (it's the same 
how `-cov` behaves at DMD).
These .lst files contain the original source code with number of 
hits of a respective line:

       2|    auto copy = new char[s.length + 1];
       2|    copy[0 .. s.length] = s[];
       2|    copy[s.length] = 0;

Maybe you haven't seen the lst files?


Btw if you use Travis, you can use an `after_success` event to 
your `.travis.yml` to upload the results to CodeCov for a nice 
visuals & PR integration:

```
after_success:
  - bash <(curl -s https://codecov.io/bash)
```

We do this on most dlang repos, e.g. 
https://github.com/dlang/phobos/pull/5503


More information about the Digitalmars-d-learn mailing list