code coverage rate 0
when I open the index.html in the broswer, code coverage rate is 0
Was there any error while running the gcov command?
Was there any error while running the gcov command?
no,
Can post me the ful terminal output? And you are just usign this repo without any local changes?
Can post me the ful terminal output? And you are just usign this repo without any local changes?
ok, I don't make any change, only execute the command in the readme.md
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On
output:
- Appending code coverage compiler flags: -g3 -O0 --coverage -- Using CPM -- CPM: Adding package [email protected] (v3.11.3) -- Using the multi-header code from /home/zsyx/worspace/cmakeExer/udemy/CppProjectTemplate-main2/build/_deps/json-src/include/ -- CPM: Adding package [email protected] (9.1.0) -- Module support is disabled. -- Version: 9.1.0 -- Build type: Debug -- CXX_STANDARD: 20 -- Required features: cxx_variadic_templates -- CPM: Adding package [email protected] (v1.13.0) -- Build spdlog: 1.13.0 -- Build type: Debug -- CPM: Adding package [email protected] (v3.1.1) -- CPM: Adding package [email protected] (v3.5.3) -- Warnings Active for: LibFoo -- Warnings as Errors: OFF -- IPO/LTO is supported: LibFoo -- Warnings Active for: LibBar -- Warnings as Errors: OFF -- IPO/LTO is supported: LibBar -- Warnings Active for: main -- Warnings as Errors: OFF -- IPO/LTO is supported: main -- Warnings Active for: UnitTestFoo -- Warnings as Errors: OFF -- Warnings Active for: UnitTestBar -- Warnings as Errors: OFF -- Configuring done (1.1s) -- Generating done (0.0s) -- Build files have been written to: /home/zsyx/worspace/cmakeExer/udemy/CppProjectTemplate-main2/build cmake --build build --config Debug --target coverage -j4 output: [ 2%] Built target fmt [ 9%] Built target spdlog [ 10%] Built target LibBar [ 12%] Built target LibFoo [ 93%] Built target Catch2 [ 95%] Built target Catch2WithMain [ 96%] Built target UnitTestBar [ 98%] Built target UnitTestFoo [100%] Running gcovr to produce HTML code coverage report. Test project /home/zsyx/worspace/cmakeExer/udemy/CppProjectTemplate-main2/build Start 1: factorial1 1/4 Test #1: factorial1 ....................... Passed 0.01 sec Start 2: helloworld1 2/4 Test #2: helloworld1 ...................... Passed 0.00 sec Start 3: sum1 3/4 Test #3: sum1 ............................. Passed 0.01 sec Start 4: branch1 4/4 Test #4: branch1 .......................... Passed 0.00 sec
100% tests passed, 0 tests failed out of 4
Total Test time (real) = 0.02 sec (INFO) Reading coverage data... (INFO) Writing coverage report... Open ./coverage/index.html in your browser to view the coverage report. [100%] Built target coverage
cd build ctest . output: Test project /home/zsyx/worspace/cmakeExer/udemy/CppProjectTemplate-main2/build Start 1: factorial1 1/4 Test #1: factorial1 ....................... Passed 0.01 sec Start 2: helloworld1 2/4 Test #2: helloworld1 ...................... Passed 0.01 sec Start 3: sum1 3/4 Test #3: sum1 ............................. Passed 0.01 sec Start 4: branch1 4/4 Test #4: branch1 .......................... Passed 0.01 sec
100% tests passed, 0 tests failed out of 4
Total Test time (real) = 0.03 sec
index.html in the browser show everything is 0