[PATCH] D151283: [llvm-cov] Support directory layout in coverage reports
Yuhao Gu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 21 23:03:53 PDT 2023
AtomicGu marked an inline comment as done.
AtomicGu added inline comments.
================
Comment at: llvm/tools/llvm-cov/CoverageReport.cpp:578
+
+ // What if we report a Windows exe on Linux? In this case, all files will
+ // be considered be directly in the project root directory as Linux allows
----------------
gulfem wrote:
> AtomicGu wrote:
> > @gulfem @phosek Any advises for this problem?
> Can you use `sys::path::native` to convert the path to native path? I looked at `native_separators.c` test:
> https://github.com/llvm/llvm-project/blob/main/llvm/test/tools/llvm-cov/native_separators.c
>
> It's a Windows test, but its `*.covmapping` file input does not include backslashes for the filenames because it converts the path read to native path:
> https://github.com/llvm/llvm-project/blob/main/llvm/test/tools/llvm-cov/Inputs/native_separators.covmapping
>
> So, what I was thinking is that you can have two separate tests `directory_coverage.linux.test` and `directory_coverage.win.test`, but they use the same inputs for *.profdata and *.covmapping files. Do you think that would work? If not, having two separate files with their own inputs should be fine.
Actually there's another difference between the two tests: the linux test uses absolute path in the .covmapping file but the windows test uses relative path.
The key problem here is: do we want to support generating reports for inputs of different platforms? I think `native_separators.c` answers "yes", so I will follow it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151283/new/
https://reviews.llvm.org/D151283
More information about the llvm-commits
mailing list