From 453ba9f0ad6ac959c0d8d167bff30aca7f818882 Mon Sep 17 00:00:00 2001 From: t-bltg Date: Mon, 12 Dec 2022 20:59:59 +0100 Subject: [PATCH] document `COV_EXCL_START`, `COV_EXCL_STOP` and `COV_EXCL_LINE` (#335) --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b532d8f..1495974 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,20 @@ Be aware of a few limitations: - a line that can take one of two branches gets marked as covered even if only one branch is tested - currently, code run by Julia's internal interpreter [is not marked as covered](https://github.com/JuliaLang/julia/issues/37059). +### Exclude specific lines or sections from coverage + +To exclude specific code blocks, surround the section with `COV_EXCL_START` and `COV_EXCL_STOP` comments: +```julia +# COV_EXCL_START +foo() = nothing +# COV_EXCL_STOP +``` + +To exclude a single line, add a comment with `COV_EXCL_LINE`: +```julia +const a = 1 # COV_EXCL_LINE +``` + ### Memory allocation Start julia with