Skip to content

Commit 93cee5a

Browse files
ayteytaiki-e
andauthored
Add support for MC/DC coverage (#363)
Co-authored-by: Taiki Endo <[email protected]>
1 parent bf45222 commit 93cee5a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/.cspell/project-dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fprofile
1010
instrprof
1111
libclang
1212
libhello
13+
mcdc
1314
microkernel
1415
MSYSTEM
1516
nextest

src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,16 @@ impl Format {
10121012
"-show-line-counts-or-regions",
10131013
"-show-expansions",
10141014
"-show-branches=count",
1015+
]);
1016+
if cmd!(&cx.llvm_cov, "show", "--help")
1017+
.read()
1018+
.unwrap_or_default()
1019+
.contains("-show-mcdc")
1020+
{
1021+
// -show-mcdc requires LLVM 18+
1022+
cmd.arg("-show-mcdc");
1023+
}
1024+
cmd.args([
10151025
&format!("-Xdemangler={}", cx.current_exe.display()),
10161026
"-Xdemangler=llvm-cov",
10171027
"-Xdemangler=demangle",

0 commit comments

Comments
 (0)