diff --git a/README.md b/README.md index aba1773..c5775fe 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,12 @@ ignore: path-mapping: - "/path1" - "/path2" +excl-br-line: "#\[(derive(.*)\]" +excl-br-start: "#\[test\]" +excl-br-stop: "cov:excl-br-stop" +excl-line: "cov:excl-line" +excl-start: "mod test" +excl-stop: "cov:excl-stop" ``` ## Notes diff --git a/src/configuration.ts b/src/configuration.ts index 6bb9de9..e730c15 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -32,6 +32,12 @@ export interface User { pathMapping?: string[], prefixDir?: string, outputPath?: string, + exclBrLine?: string, + exclBrStart?: string, + exclBrStop?: string, + exclLine?: string, + exclStart?: string, + exclStop?: string, } /** @@ -125,6 +131,24 @@ async function loadUser(path: string): Promise { if (contents['prefix-dir']) { user.prefixDir = contents['prefix-dir']; } + if (contents['excl-br-line']) { + user.exclBrLine = contents['excl-br-line']; + } + if (contents['excl-br-start']) { + user.exclBrStart = contents['excl-br-start']; + } + if (contents['excl-br-stop']) { + user.exclBrStop = contents['excl-br-stop']; + } + if (contents['excl-line']) { + user.exclLine = contents['excl-line']; + } + if (contents['excl-start']) { + user.exclStart = contents['excl-start']; + } + if (contents['excl-stop']) { + user.exclStop = contents['excl-stop']; + } if (contents['output-path']) { user.outputPath = contents['output-path']; } else if (contents['output-file']) { diff --git a/src/grcov.ts b/src/grcov.ts index 4b57504..617f67a 100644 --- a/src/grcov.ts +++ b/src/grcov.ts @@ -111,6 +111,36 @@ export class Grcov { args.push(config.user.prefixDir); } + if (config.user.exclBrLine) { + args.push('--excl-br-line'); + args.push(config.user.exclBrLine); + } + + if (config.user.exclBrStart) { + args.push('--excl-br-start'); + args.push(config.user.exclBrStart); + } + + if (config.user.exclBrStop) { + args.push('--excl-br-stop'); + args.push(config.user.exclBrStop); + } + + if (config.user.exclLine) { + args.push('--excl-line'); + args.push(config.user.exclLine); + } + + if (config.user.exclStart) { + args.push('--excl-start'); + args.push(config.user.exclStart); + } + + if (config.user.exclStop) { + args.push('--excl-stop'); + args.push(config.user.exclStop); + } + // TODO: // args.push('--service-job-number'); // args.push('');