ThrowTheSwitch / Ceedling

Ruby-based unit testing and build system for C projects

Home Page:http://throwtheswitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GcovCoverageResults are generated empty when build_root is outside of the project folder

slavko-m opened this issue · comments

Hi,

When I change build_root to a folder above the folder where project.yml is, GcovCoverageResults are generated, but empty.

:project:
  :use_exceptions: FALSE
  :use_test_preprocessor: TRUE
  :use_auxiliary_dependencies: TRUE
  :build_root: "../build"

I get no errors on console, and generating coverage report works fine:

---------------------------
GCOV: CODE COVERAGE SUMMARY
---------------------------
some_lib.c Lines executed:80.00% of 15
some_lib.c Branches executed:75.00% of 8
some_lib.c Taken at least once:62.50% of 8
some_lib.c Calls executed:100.00% of 1
some_lib.c Lines executed:80.00% of 15

but html files are empty. If build_root is "build" or "some_folder/build" it works correctly. Any ideas what's wrong?

    Ceedling:: 0.31.1
       CMock:: 2.5.4
       Unity:: 2.5.4
  CException:: 1.3.3

I added

args += "--object-directory \"#{File.expand_path(GCOV_BUILD_PATH)}\" "

alongside other options in the args_builder_common function from gcovr_reportinator.rb, and now it works correctly. I'm not sure if there is another solution that doesn't involve changing the source code.