I’m trying to replicate a workflow I use from gcov with llvm. My workflow is this:<div>1) Build my code with coverage instrumentation</div><div>2) Run a test</div><div>3) Get a binary coverage artifact for the test</div><div>4) Filter the binary artifact to a certain set of files (the “files under test”</div><div>5) Go to 2 for other tests in the test suite. Steps 2-4 might also be run multiple times in parallel. </div><div>6) Now that all tests are run and filtered, merge all the binary coverage objects.</div><div>7) Make an html report from the merged object</div><div><br></div><div>Note that a merge of filtered coverage artifacts is not the same as a filter of merged coverage artifacts. For example, I run two tests: one is a unit test of a math library, and the other is a unit test of some application that uses the math library. What I want to do is filter the math unit test coverage output to show only the math library files, and filter the application test coverage output to show only the application’s files. Then I want to join them all into one report. The filtering must happen before the merge. </div><div><br></div><div>With llvm-cov, I can create filtered reports from binary artifacts (*.profdata files), and with llvm-profdata I can merge binary artifacts. However, I’m not aware of a method of merging some intermediate coverage data that has been filtered. </div><div><br></div><div>I thought that perhaps the json output from “llvm-cov export” would help here; I could use “llvm-cov export -instr-profile=coverage1.profdata MathTest math.c” to create a json of the filtered math test. However, this doesn’t seem like a solution for at least two reasons:</div><div>1) I am not aware of an existing tool for merging the json output from multiple invocations of “llvm-cov export”</div><div>2) I am not aware of a tool that produces html reports from the json format, even if I could merge them. </div><div><br></div><div><br></div><div>Is my workflow possible? It’s easy with gcov, but I don’t know if it supported by llvm coverage. </div>