Gcov for C++ failed

Hi
I use the UT gcov, but when I push the report to sonarqube there is no log line related to gcov
this is my config
sh "sonar-scanner -X " +
"-Dsonar.login=${token_sonarqube} " +
"-Dsonar.host.url=${sonar_host_url} " +
"-Dsonar.projectKey=${project} " +
"-Dsonar.projectName=${project} " +
"-Dsonar.cfamily.build-wrapper-output=./out/ " +
"-Dsonar.cfamily.gcov.reportsPath=./build_linux/gcoverage " +
"-Dsonar.branch.name=${branch} " +
"-Dsonar.sourceEncoding=UTF-8 " +
"-Dsonar.exclusions=/covoutput/,/*.html,/.css,**/.py,/*.js,/*.xml " +
"-Dsonar.sources=. " +
“-Dsonar.projectVersion=${currentBuild.number}_${branch}”
}
this is 1 of 4 files located in /build_linux/gcoverage
gtest_main.cpp.gcov
file:/home/jenkins/workspace/NXT.PROD.SVM/NXT.PROD.SVM.DEV-Pipeline/core/modules/test/src/gtest_main.cpp
function:5,1,main
function:10,1,_GLOBAL__sub_I_gtest_main.cpp
function:10,1,_Z41__static_initialization_and_destruction_0ii
lcount:5,1
lcount:6,2
branch:6,taken
branch:6,nottaken
branch:6,taken
branch:6,nottaken
lcount:7,1
branch:7,taken
branch:7,nottaken
lcount:8,1
branch:8,taken
branch:8,nottaken
branch:8,taken
branch:8,nottaken
branch:8,taken
branch:8,nottaken
lcount:9,1
branch:9,taken
branch:9,nottaken
lcount:10,3
branch:10,taken
branch:10,nottaken
branch:10,taken
branch:10,nottaken

Looking forward to your help

@Julien_HENRY Can you help me

Hi @D_c_Tu_n_Mai,

Please refrain from tagging individual SonarSourcers.

Can you please upload the scanner full logs?

Thanks,

build-log.txt (330.4 KB)
sorry i tagged, this is my diary
i have set path for report -Dsonar.cfamily.gcov.reportsPath=build_linux/gcoverage
but it doesn’t work either

@D_c_Tu_n_Mai,

int the shares report you have:

sonar-scanner -X -Dsonar.login=****** -Dsonar.host.url=https://sonar1.fsoft.com.vn -Dsonar.projectKey=NXT.PROD.SVM -Dsonar.projectName=NXT.PROD.SVM -Dsonar.cfamily.build-wrapper-output=build_wrapper_output_dir -Dsonar.cfamily.gcov.reportsPath=. -Dsonar.branch.name=develop -Dsonar.sourceEncoding=UTF-8 -Dsonar.exclusions=/covoutput/,/*.html,/.css,**/.py,/*.js,/*.xml -Dsonar.sources=. -Dsonar.projectVersion=174_develop

Please fix -Dsonar.cfamily.gcov.reportsPath=. to reflect your gcov reports directory and try again.

Thanks,

I also tried editing the path but it still doesn’t work
this is my .gcov file directory


this is my config
withSonarQubeEnv(credentialsId: ‘sonar_checkqlty’, installationName: ‘DevOps-Sonar1’) {
sh "sonar-scanner -X " +
"-Dsonar.login=${token_sonarqube} " +
"-Dsonar.host.url=${sonar_host_url} " +
"-Dsonar.projectKey=${project} " +
"-Dsonar.projectName=${project} " +
"-Dsonar.cfamily.build-wrapper-output=build_wrapper_output_dir " +
"-Dsonar.cfamily.gcov.reportsPath=/build_linux/gcoverage " +
"-Dsonar.branch.name=${branch} " +
"-Dsonar.sourceEncoding=UTF-8 " +
"-Dsonar.exclusions=/covoutput/,/*.html,/.css,**/.py,/*.js,/*.xml " +
"-Dsonar.sources=. " +
“-Dsonar.projectVersion=${currentBuild.number}_${branch}”
}
build-log.txt (330.5 KB)

@D_c_Tu_n_Mai,
You are using SQ Community 7.9.3.33349.
C++ analysis including the coverage requires the SQ developer edition. or SonarCloud if you have an open-source project and you want a free option.
Currently, you are using an unofficial CXX plugin to do the analysis that doesn’t support the build-wrapper and coverage option:

18:19:54.336 DEBUG: * C++ (Community) 1.3.3.2051 (cxx)

Thanks,

so I can’t use SQ Community to upload gcov report for C++ source code
Thank you for replying to me, it’s so sad

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.