Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line endings issue with clang #49644

Open
dsakilesh opened this issue May 11, 2021 · 1 comment
Open

Line endings issue with clang #49644

dsakilesh opened this issue May 11, 2021 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@dsakilesh
Copy link

Bugzilla Link 50300
Version 11.0
OS Linux
CC @zygoloid

Extended Description

Hi Team,

We generate the xml report for our project using gcovr( version 4.2) and clang (version 11.0)

We are facing the line endings issue. The xml file generated as part of the gcov and clang commands seems to contains more data than actual lines in the file. Sonarqube-scanner is not able to find the lines mentioned in the xml and hence fails the build.

We tried to fix the line endings issue by:

.gitattributes approach to fix the line endings but no luck

checked if it contains multiple files with same name and the answer is No

there are no old gcno/gcna files available in the workspace

After addition of warnings in the gcovr, we get the below output/warnings:

WARNING: File src/src/ButtonManager/HardwareButtonHandler.cpp has 73 line(s) but coverage data has 74 line(s).
WARNING: File src/src/ConfigurationInstaller/ConfigurationInstaller.cpp has 145 line(s) but coverage data has 155 line(s).
WARNING: File src/src/Filesystem/Filesystem.cpp has 258 line(s) but coverage data has 549 line(s).
WARNING: File src/src/Lbtp/Client.cpp has 224 line(s) but coverage data has 404 line(s).
WARNING: File src/src/Led/Patterns/AssistanceModePattern.cpp has 46 line(s) but coverage data has 82 line(s).
WARNING: File src/src/SystemUpdater/AllComponents.cpp has 44 line(s) but coverage data has 177 line(s).
WARNING: File src/src/SystemUpdater/ComponentBase.cpp has 221 line(s) but coverage data has 417 line(s).
WARNING: File src/src/Ui/Data/BatteryPackData.cpp has 53 line(s) but coverage data has 85 line(s).
WARNING: File src/src/Ui/Views/BackgroundView.cpp has 69 line(s) but coverage data has 76 line(s).
WARNING: File src/src/Ui/Views/BlePairingModeView.cpp has 128 line(s) but coverage data has 194 line(s).
WARNING: File src/src/Ui/Views/CriticalErrorView.cpp has 56 line(s) but coverage data has 78 line(s).
WARNING: File src/src/Ui/Views/DiagnosisProgramView.cpp has 35 line(s) but coverage data has 69 line(s).
WARNING: File src/src/Ui/Views/GoodByeView.cpp has 60 line(s) but coverage data has 79 line(s).
WARNING: File src/src/Ui/Views/NonCriticalErrorView.cpp has 83 line(s) but coverage data has 97 line(s).
WARNING: File src/src/Ui/Views/SoftwareUpdateView.cpp has 80 line(s) but coverage data has 88 line(s).
WARNING: File src/src/Ui/Views/StateOfChargeView.cpp has 60 line(s) but coverage data has 92 line(s).
WARNING: File src/src/Ui/Views/WalkAssistActiveStateView.cpp has 62 line(s) but coverage data has 69 line(s).
WARNING: File src/src/Ui/Views/WelcomeView.cpp has 52 line(s) but coverage data has 76 line(s).

Command use for xml generation:

python -m gcovr --gcov-executable="llvm-cov gcov" -v --root /var/jenkins/0/workspace/_feature_align-coverage-metrics2 --branches -f '/var/jenkins/0/workspace/_feature_align-coverage-metrics2/build/unittest-clang/BRC36xx-5/Debug/(src|include)/' -f '/var/jenkins/0/workspace/_feature_align-coverage-metrics2/src/(src|include)/' --object-dir=. --exclude-directories '/var/jenkins/0/workspace/_feature_align-coverage-metrics2/build/unittest-gcc/' --html-details=gcovreport/index.html --sonarqube=gcovreport/sonarqube.xml

For more details refer to the github issue:
gcovr/gcovr#345

Regards,
Akilesh D S

@dsakilesh
Copy link
Author

Hi team,

Is there an update on this topic?

Let us know if you need more details.

Thanks in advance!

Regards,
Akilesh D S

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

1 participant