CppProjectTemplate icon indicating copy to clipboard operation
CppProjectTemplate copied to clipboard

code coverage rate 0

Open gotosleeponesummer opened this issue 11 months ago • 4 comments

when I open the index.html in the broswer, code coverage rate is 0

gotosleeponesummer avatar Jan 22 '25 09:01 gotosleeponesummer

Was there any error while running the gcov command?

franneck94 avatar Jan 22 '25 09:01 franneck94

Was there any error while running the gcov command?

no,

gotosleeponesummer avatar Jan 22 '25 10:01 gotosleeponesummer

Can post me the ful terminal output? And you are just usign this repo without any local changes?

franneck94 avatar Jan 22 '25 10:01 franneck94

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

gotosleeponesummer avatar Jan 22 '25 10:01 gotosleeponesummer