Code coverage with Alire

I didn’t realize code coverage works out of the box with Alire on Linux (no messing with compiler switches). I can’t get this to work on Windows though, the gnatcov instrument step fails while returning 1.

alr with gnatcov
alr build && alr gnatcov instrument --level=stmt --dump-trigger=atexit --projects=YOUR.gpr
alr build -- --src-subdirs=gnatcov-instr --implicit-with=gnatcov_rts_full.gpr
# RUN YOUR PROGRAM HERE
alr gnatcov coverage --annotate=html --output-dir gnatcov_out --level=stmt --projects YOUR.gpr *.srctrace
2 Likes