-
-
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
GCOV Fails to use g++? #999
Comments
Can you style it using code block https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#fenced-code-blocks ? Not sure what you mean with verification? If it produces what you want, then its verified. I would advise you to use |
Thank you for your response. While testing a .c file that includes a .hpp file, I encountered the following error: fatal error: cstdlib: No such file or directory. I am running Ceedling within a Docker environment. |
To address the previous issue, I updated the YAML file paths as follows: yaml :test: With this configuration, ceedling test:all runs successfully. However, ceedling gcov:all fails because gcov defaults to using gcc instead of g++. Could you advise on the necessary changes to ensure gcov uses g++? |
@Ash-BV First, a request. When you post configurations, please use code formatting. Project configuration posted as simple text is quite difficult to read. You can highlight code or configuration and then click or tap the code
Second, there is a shortcut you can use to change just the executable for a tool definition [documentation]. For your specific request of running :tools_gcov_compiler:
:executable: g++
:tools_gcov_linker:
:executable: g++ I have not tested this configuration to see if running g++ with coverage options will produce what you want. It may take additional configuration to successfully mix C and C++ conventions and code. |
I have created a YAML configuration file to test C++ files and generate a report using Ceedling. I would like to request verification of this file to ensure it is correctly configured.
=========================================================================
Ceedling - Test-Centered Build System for C
ThrowTheSwitch.org
Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
SPDX-License-Identifier: MIT
=========================================================================
:project:
:which_ceedling: gem
:ceedling_version: 1.0.0
:use_mocks: TRUE
:use_test_preprocessor: :all # options are :none, :mocks, :tests, or :all
:use_backtrace: :simple # options are :none, :simple, or :gdb
:use_decorators: :auto # decorate Ceedling's output text. options are :auto, :all, or :none
:use_exceptions: FALSE
:use_auxiliary_dependencies: TRUE
:build_root: UTbuild
:test_file_prefix: test_
:default_tasks:
- test:all
:test_threads: 8
:compile_threads: 8
:environment:
:extension:
:c: c
:cpp: cpp
:h: h
:hpp: hpp
:executable: .out
:paths:
:source:
- app/src
- base/src
- gui/src
- test
- test/support
- /usr/local/bundle/gems/ceedling-1.0.0/vendor/unity/src
- /usr/local/bundle/gems/ceedling-1.0.0/vendor/cmock/src
- /usr/local/bundle/gems/ceedling-1.0.0/vendor/c_exception/lib
:test:
- test
:support:
- test/support
:include:
- app/src
- base/src
- gui/src
- test/mocks
- /usr/local/bundle/gems/ceedling-1.0.0/vendor/unity/src
- /usr/local/bundle/gems/ceedling-1.0.0/vendor/cmock/src
- /usr/local/bundle/gems/ceedling-1.0.0/vendor/c_exception/lib
:libraries: []
:cmock:
:mock_prefix: mock_
:mock_path: 'test/mocks'
:when_no_prototypes: :warn
:enforce_strict_ordering: TRUE
:plugins:
- :ignore
- :callback
- :expect_any_args
- :ignore_arg
- :return_thru_ptr
:treat_as:
uint8: HEX8
uint16: HEX16
uint32: UINT32
int8: INT8
bool: UINT8
:functions:
:exclude:
- XIic_IsIicBusy
:defines:
:common: &common_defines
- UNIT_TEST=1
:test:
- *common_defines
- TEST
- UNIT_TEST=1
- CEXCEPTION_USE_CONFIG_FILE
:test_preprocess:
- *common_defines
- TEST
- CEXCEPTION_USE_CONFIG_FILE
:libraries:
:placement: :end
:flag: "-l${1}"
:path_flag: "-L ${1}"
:system: [] # for example, you might list 'm' to grab the math library
:test: []
:release: []
:tools:
:gcov:
:executable: gcov
:name: 'gcov'
:args:
- -r
- .
- --html
- --html-details
:gcov_compiler:
:executable: g++
🎏
- "-std=c++11"
- "-Wall"
- "-Werror"
- "-fprofile-arcs"
- "-ftest-coverage"
- "-fno-exceptions"
:includes:
- "app/src"
- "base/src"
- "gui/src"
- "test"
- "test/support"
- "/usr/local/bundle/gems/ceedling-1.0.0/vendor/unity/src"
- "/usr/local/bundle/gems/ceedling-1.0.0/vendor/cmock/src"
:gcov_linker:
:executable: g++
🎏
- "-std=c++11"
- "-Wall"
- "-Werror"
- "-lgcov"
:plugins:
:enabled:
- gcov # gcov must be enabled as a plugin in order to generate a coverage report
- module_generator
:coverage:
:tool: gcovr
:gcovr:
:html: true
:html_details: true
:html_output: "UTbuild/artifacts/gcov/coverage_report.html"
:project_root: .
:output:
:coverage_html_report_path: UTbuild/coverage
:gcov:
:report_types:
- HTML
:html_report_type: detailed
The text was updated successfully, but these errors were encountered: