-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
ceedling gcov:all Fails for Mixed C and C++ Files #993
Comments
Gcov does not use
And let the Ceedling add the flags and includes automatically (meaning you need to port your |
Thanks for your reply. |
Hi, @sujit-dhs. Thank you for this report and sorry for the trouble. Thank you @Letme for suggesting the fix you did with the new Ceedling feature. @sujit-dhs Can you kindly run with verbosity increased ( |
I ran the command with --verbosity debug (ceedling gcov:all --verbosity debug) to gather more details, and the logs are as follows: 👟 Test RunnersGenerating runner for test_buck_txbits.c... 👟 Determining Artifacts to Be Built... 👟 Building ObjectsPlugin | Gcov > :pre_compile_execute... Debug Backtrace ==> |
I'm encountering an issue with Ceedling when running code coverage (ceedling gcov:all) on a project that includes both C and C++ files. My project contains headers and source files with a mix of C and C++ code, and I've configured the test_compiler and test_linker in project.yml to use g++.
Running ceedling test:all works perfectly, but when I try to generate coverage reports using ceedling gcov:all, the process fails, and no report is generated. Below is a summary of my setup and configuration:
:tools:
:gcov:
:executable: gcov
:name: 'gcov'
:args:
- -r
- .
- --html
- --html-details
:arguments:
- --coverage
:test_compiler:
:executable: g++
:arguments:
- "-m32"
- "-Wall"
- "-Werror"
- "-std=c++11"
- -I"/usr/local/bundle/gems/ceedling-1.0.0/vendor/unity/src"
- -I"/usr/local/bundle/gems/ceedling-1.0.0/vendor/cmock/src"
- -I"test/mocks"
- -I"test/mocks/test_pwm"
- -I"test/mocks/test_comm"
- -I"test/mocks/test_control"
- -I"test/mocks/test_commands"
- -I"test"
- -I"test/support"
- -I"app/src"
- -I"base/src"
- -I"gui/src"
- -DTEST
- -DUNIT_TEST=1
- -DGNU_COMPILER
- -g
- -fprofile-arcs
- -ftest-coverage
- -fno-exceptions
- -c
- ${1}
- -o ${2}
- -MMD
- -MF ${3}
- -Wno-sign-compare # Disable sign comparison warning
- -Wno-unused-variable
#- -Wno-int-to-pointer-cast
- -fpermissive
:before_compile:
echo "#ifdef __cplusplus" > ${1}.cpp
echo "extern "C" {" >> ${1}.cpp
cat ${1} >> ${1}.cpp
echo "}" >> ${1}.cpp
echo "#endif" >> ${1}.cpp
:test_linker:
:executable: g++
:arguments:
- "-m32"
- "-Wall"
- "-Werror"
- -o ${2}
- ${1}
- -g
- -lm
- -lgcov
The text was updated successfully, but these errors were encountered: