Linux Host Unit test Coverage - ESP-IDF

Anviori
Posts: 2
Joined: Tue Oct 17, 2023 6:36 pm

Linux Host Unit test Coverage - ESP-IDF

Postby Anviori » Sun Jun 09, 2024 11:36 pm

Hello,

I'm having trouble setting code coverage generation for my unit testing. I'm able to run my tests perfectly fine and I'm able to generate .gcno files by adding --coverage to the build process for both the test source file and the sources for the custom component I'm testing. The problem is the resulting .gcda when I run the test binary are only created for the test source .gcno files, but not for the component sources, even though the test includes the files and calls the functions.
This is my current directory structure:

Code: Select all

├── CMakeLists.txt (1)
├── component_file.c
├── component_file.h
├── host_test
│   ├── component_unit_tests
│   │   ├── CMakeLists.txt (2)
│   │   ├── main
│   │   │   ├── CMakeLists.txt (3)
│   │   │   └── component_unit_tests.c
│   │   └── sdkconfig.defaults
/code]

I've attached the contents of all three cmakelist files. Any insight on this is greatly appreciated. Thanks
Attachments
CMakeLists (3).txt
(457 Bytes) Downloaded 53 times
CMakeLists (2).txt
(335 Bytes) Downloaded 52 times
CMakeLists (1).txt
(460 Bytes) Downloaded 51 times

BipinDangwal
Posts: 3
Joined: Tue Nov 05, 2024 7:55 am

Re: Linux Host Unit test Coverage - ESP-IDF

Postby BipinDangwal » Tue Nov 05, 2024 7:58 am

Did you get the answer

Anviori
Posts: 2
Joined: Tue Oct 17, 2023 6:36 pm

Re: Linux Host Unit test Coverage - ESP-IDF

Postby Anviori » Wed Nov 06, 2024 4:19 pm


BipinDangwal
Posts: 3
Joined: Tue Nov 05, 2024 7:55 am

Re: Linux Host Unit test Coverage - ESP-IDF

Postby BipinDangwal » Tue Nov 19, 2024 4:49 pm

I have windows will it work there if I install wsl?

Who is online

Users browsing this forum: No registered users and 402 guests