Code coverage in Phobos
Seb via Digitalmars-d
digitalmars-d at puremagic.com
Sun Mar 27 18:30:34 PDT 2016
AFAIK dmd supports the `-cov` flag since quite some time, so I
would be interested why there's no code coverage bot. There also
seems to exist at least two external platforms that allow such
code coverage analyzing [1, 2]. Is this already on your roadmap?
[1] https://github.com/codecov/example-d
[2] https://github.com/ColdenCullen/doveralls/issues/16
Anyways it seems pretty easy to hack something quick&dirty
together that could be pretty helpful:
```
for f in $(find . -name '*.d' -type f -not -path './c/*'); do
;fe="${f%.*}"; (cd $(dirname "$f") && rdmd -cov -unittest -main
"$(basename $f)") && printf "$f " && tail -n1 "$fe".lst | cut -f3
-d ' ' ; done | sort
```
./algorithm/comparison.d 95%
./algorithm/internal.d no
./algorithm/iteration.d 96%
./algorithm/mutation.d 99%
./algorithm/package.d no
./algorithm/searching.d 97%
./algorithm/setops.d 94%
./algorithm/sorting.d 98%
./array.d 95%
./ascii.d 100%
./base64.d 94%
./bigint.d 97%
./bitmanip.d 96%
./compiler.d no
./complex.d 96%
./concurrencybase.d 100%
./container/array.d 94%
./container/binaryheap.d 59%
./container/dlist.d 92%
./container/package.d 1%
./container/rbtree.d 94%
./container/slist.d 95%
./container/util.d 100%
./conv.d 94%
./cstream.d 92%
./datetime.d 94%
./demangle.d 0%
./digest/crc.d 100%
./digest/digest.d 72%
./digest/hmac.d 100%
./digest/md.d 100%
./digest/ripemd.d 100%
./digest/sha.d 80%
./encoding.d 66%
./exception.d 92%
./experimental/allocator/building_blocks/affix_allocator.d 71%
./experimental/allocator/building_blocks/allocator_list.d 81%
./experimental/allocator/building_blocks/bitmapped_block.d 91%
./experimental/allocator/building_blocks/bucketizer.d 48%
./experimental/allocator/building_blocks/fallback_allocator.d 89%
./experimental/allocator/building_blocks/free_list.d 75%
./experimental/allocator/building_blocks/kernighan_ritchie.d 80%
./experimental/allocator/building_blocks/null_allocator.d 56%
./experimental/allocator/building_blocks/package.d no
./experimental/allocator/building_blocks/quantizer.d 69%
./experimental/allocator/building_blocks/region.d 70%
./experimental/allocator/building_blocks/scoped_allocator.d 78%
./experimental/allocator/building_blocks/segregator.d 50%
./experimental/allocator/building_blocks/stats_collector.d 95%
./experimental/allocator/common.d 88%
./experimental/allocator/gc_allocator.d 92%
./experimental/allocator/mmap_allocator.d 100%
./experimental/allocator/showcase.d 100%
./experimental/allocator/typed.d 54%
./experimental/logger/core.d 99%
./experimental/logger/filelogger.d 91%
./experimental/logger/multilogger.d 100%
./experimental/logger/nulllogger.d 100%
./experimental/logger/package.d no
./experimental/ndslice/internal.d 100%
./experimental/ndslice/iteration.d 100%
./experimental/ndslice/package.d 91%
./experimental/ndslice/selection.d 97%
./experimental/ndslice/slice.d 95%
./file.d 93%
./format.d 92%
./functional.d 88%
./internal/cstring.d 93%
./internal/digest/sha_SSSE3.d 0%
./internal/math/biguintcore.d 58%
./internal/math/biguintnoasm.d 75%
./internal/math/biguintx86.d no
./internal/math/errorfunction.d 92%
./internal/math/gammafunction.d 94%
./internal/processinit.d no
./internal/scopebuffer.d 98%
./internal/test/dummyrange.d 100%
./internal/test/uda.d no
./internal/unicode_comp.d 0%
./internal/unicode_decomp.d 0%
./internal/unicode_grapheme.d no
./internal/unicode_norm.d no
./internal/unicode_tables.d 0%
./internal/windows/advapi32.d no
./json.d 93%
./math.d 92%
./mathspecial.d 47%
./meta.d 97%
./mmfile.d 61%
./net/curl.d 68%
./net/isemail.d 84%
./numeric.d 72%
./outbuffer.d 54%
./parallelism.d 88%
./path.d 97%
./random.d 94%
./range/interfaces.d 78%
./range/package.d 92%
./range/primitives.d 90%
./regex/internal/backtracking.d 0%
./regex/internal/generator.d 56%
./regex/internal/kickstart.d 87%
./regex/internal/parser.d 29%
./regex/internal/tests.d 99%
./regex/internal/thompson.d no
./regex/package.d 90%
./signals.d 92%
./socketstream.d 0%
./stdint.d no
./stdio.d 76%
./stdiobase.d 100%
./stream.d 61%
./string.d 99%
./system.d no
./typecons.d 90%
./typetuple.d 80%
./uni.d 91%
./utf.d 90%
./uuid.d 97%
./variant.d 92%
./windows/charset.d no
./windows/iunknown.d no
./windows/registry.d no
./windows/syserror.d no
./xml.d 64%
./zip.d 90%
./zlib.d 60%
More information about the Digitalmars-d
mailing list