[coverage] Compiling by clang, and coverage report doesn't show the header files
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
if I use includes [] by -isystem to specify the header files, coverage report doesn't show it.
main.c:
```
#include
#include"gov.h"
int g_a = 10;
int main(){
printf("%d\n", foo(g_a));
return 0;
}
```
gg/gov.h:
```
static inline int foo(int a){
return -1;
}
include = [gg/gcov]
```
report:
```
1| |#include
2| |#include"gov.h"
3| |int g_a = 10;
4| 1|int main(){
5| 1| printf("%d\n", foo(g_a));
6| 1| return 0;
7| 1|}
8| |
```
During engineering-level compilation, if other C/CPP files include this header file using the -I option, it may lead to inaccurate coverage results.
Contributor guide
Research direction
Reproduce the coverage report with main.c, gg/gov.h, the -isystem include, and the contrasting -I case. Then inspect Bazel's coverage compilation and report handling for headers; done means a regression test shows the affected header files accurately in the coverage output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100