From 49aa3458e5c54647ec92554ca3c0fd466c4f1429 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Sun, 7 Apr 2024 18:22:56 +0100 Subject: [PATCH] Add details on how to view coverage locally Unfortunately for now, Coveralls reports don't include source due to #84, but this is a good workaround. --- CONTRIBUTING.md | 12 ++++++++++++ Makefile.am | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f6399c..1752a8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,6 +90,18 @@ recommended to put them in a subdirectory called `playground/` since this will be automatically ignored by git and the build process, avoiding any undesirable complications. +Test coverage +~~~~~~~~~~~~~ + +To view test coverage reports, first ensure that +[`Devel::Cover`](https://metacpan.org/dist/Devel-Cover) is installed. +Then type `make coverage`. The last lines of the output should +include something like: + + HTML output written to /home/user/path/to/stow/cover_db/coverage.html + +which you can open in a web browser to view the report. + Translating Stow ---------------- diff --git a/Makefile.am b/Makefile.am index 56abbef..96eedb1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,6 +87,10 @@ check-TESTS: dir=$(TESTS_DIR); \ $(TESTS_ENVIRONMENT) -MTest::Harness -e 'runtests(@ARGV)' "$${dir#./}"/*.t +coverage: + PERL5OPT=-MDevel::Cover $(MAKE) check-TESTS + cover + $(TESTS_OUT): mkdir -p $@