Can't Enable GCOV in VSCode
Posted: Tue Jul 08, 2025 11:11 am
Hi,
I've tried to enable code coverage for unit testing in many ways but with no success. I follow instructions from https://docs.espressif.com/projects/vsc ... f-coverage page.
According to this guide I need to execute the following command to enable apptracing and gcov:. When I execute it I get the following output:
I've also tried with the idf.py menuconfig command, searched for apptrace options but found nothing about.
I really can't see those config symbols neither in the SDK Config interface nor in the sdkconfig file itself. Ain't those symbols should be generated automatically by Kconfig? How do I enable gcov for code coverage in this case?
It is a test app that implement unit tests on a custom component I develop. What is the key thing that I am missing? Is it something has to do with cmake configuration? Thank you.
For reference, here is some information about my setup:
OS: Linux
ESP-IDF SDK version: 5.4.2
Project repo: https://git.kozmotronik.com.tr/Kozmotro ... /test_apps
I've tried to enable code coverage for unit testing in many ways but with no success. I follow instructions from https://docs.espressif.com/projects/vsc ... f-coverage page.
According to this guide I need to execute the following command to enable apptracing and gcov:
Code: Select all
ESP-IDF: Configure Project SDKConfig for CoverageAnd a popup shows me this message:{"version": 2, "set": { "APPTRACE_DEST_TRAX": true, "APPTRACE_GCOV_ENABLE": true }}
{"version":2,"save":"/disk/Projeler/ESP-Components/relay_chn/test_apps/sdkconfig"}
---------------------------ERROR--------------------------
Error: The following config symbol(s) were not found: APPTRACE_DEST_TRAX, APPTRACE_GCOV_ENABLE
-----------------------END OF ERROR-----------------------
{"version": 2, "values": {}, "ranges": {}, "visible": {}, "error": ["The following config symbol(s) were not found: APPTRACE_DEST_TRAX, APPTRACE_GCOV_ENABLE"]}
Saving config to /disk/Projeler/ESP-Components/relay_chn/test_apps/sdkconfig...
{"version": 2, "values": {}, "ranges": {}, "visible": {}}
Then I've tried to set them manually in SDK Config interface, but nothing exists below the Component config about Application Level Tracing.Your project sdkconfig has been configured. Make sure to compile the source file with the --coverage option.
I've also tried with the idf.py menuconfig command, searched for apptrace options but found nothing about.
I really can't see those config symbols neither in the SDK Config interface nor in the sdkconfig file itself. Ain't those symbols should be generated automatically by Kconfig? How do I enable gcov for code coverage in this case?
It is a test app that implement unit tests on a custom component I develop. What is the key thing that I am missing? Is it something has to do with cmake configuration? Thank you.
For reference, here is some information about my setup:
OS: Linux
ESP-IDF SDK version: 5.4.2
Project repo: https://git.kozmotronik.com.tr/Kozmotro ... /test_apps