Skip to content

Commit

Permalink
Add support for MC/DC coverage (#363)
Browse files Browse the repository at this point in the history
Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
aytey and taiki-e authored Jul 18, 2024
1 parent bf45222 commit 93cee5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/.cspell/project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fprofile
instrprof
libclang
libhello
mcdc
microkernel
MSYSTEM
nextest
Expand Down
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,16 @@ impl Format {
"-show-line-counts-or-regions",
"-show-expansions",
"-show-branches=count",
]);
if cmd!(&cx.llvm_cov, "show", "--help")
.read()
.unwrap_or_default()
.contains("-show-mcdc")
{
// -show-mcdc requires LLVM 18+
cmd.arg("-show-mcdc");
}
cmd.args([
&format!("-Xdemangler={}", cx.current_exe.display()),
"-Xdemangler=llvm-cov",
"-Xdemangler=demangle",
Expand Down

0 comments on commit 93cee5a

Please sign in to comment.