Page 1 of 1

Linux Host Unit test Coverage - ESP-IDF

Posted: Sun Jun 09, 2024 11:36 pm
by Anviori
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

Re: Linux Host Unit test Coverage - ESP-IDF

Posted: Tue Nov 05, 2024 7:58 am
by BipinDangwal
Did you get the answer

Re: Linux Host Unit test Coverage - ESP-IDF

Posted: Wed Nov 06, 2024 4:19 pm
by Anviori

Re: Linux Host Unit test Coverage - ESP-IDF

Posted: Tue Nov 19, 2024 4:49 pm
by BipinDangwal
I have windows will it work there if I install wsl?