Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

/**
Expand Down Expand Up @@ -125,6 +131,24 @@ async function loadUser(path: string): Promise<User> {
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']) {
Expand Down
30 changes: 30 additions & 0 deletions src/grcov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down