Share an example for unit testing esp32 project?

659 views
Skip to first unread message

Billy McGrath

unread,
Aug 24, 2022, 8:06:04 PM8/24/22
to ThrowTheSwitch Forums
Hi,

I want to use ceedling to build and run unit tests for an esp32 project. I don't want to use ceedling to build target releases, I will do that directly with the esp-idf toolchain.

I am using the throwtheswitch/madsciencelab docker image. I have copied the esp32 station_example project to test this out. I was able to add an edge (leaf?) component and build and test unit tests and release targets. Then I moved on to trying to test app_main().

Now I'm having issues including the 'esp-idf/components' in my project.yml. When I include the whole dir I get error as mentioned in https://github.com/ThrowTheSwitch/Ceedling/issues/560 and trying to include just what is needed I still keep getting "missing file" type errors. It's a big pain.

Does anyone have an example of a working esp32 project.yml that builds unit tests and mocks esp-idf components e.g. mock_esp_wifi.h ?? I would be so grateful for some help here.

Suryagiridhar Kenguva

unread,
Aug 25, 2022, 8:10:11 AM8/25/22
to ThrowTheSwitch Forums
Hi,

I tried in the past to setup ceedling with ESP32 IDF but was unsuccessful. In case it helps, ESP-IDF has Unity integrated in it which is ceedling based on. You may consider using it in the worst case if it fits your objectives. I would also like to see if there is a working example with ceedling.
FYI, I personally didn't want to spend too much setting up ceedling and eventually moved to using Unity.

Billy McGrath

unread,
Sep 26, 2022, 2:10:56 PM9/26/22
to ThrowTheSwitch Forums

My strategy is to use ceedling to build tests and use ESP-IDF to build for the target. I keep them as separate parallel build processes and it works well for my needs. Hope it's helpful.
Reply all
Reply to author
Forward
0 new messages