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 $@