Hi,
I want to use the unit testing framework that comes with IDF on code that is not ESP32 specific and for expedience I want to run it on my dev machine, and not any ESP32 Device Under Test (DUT)
Has anyone got any tips or pointers on how todo that using the existing tools and component conventions provided with the IDF?
Thanks in advance!
Unit testing, on the host (gcc x86_64)
Re: Unit testing, on the host (gcc x86_64)
I am also interested in running unit tests on a host machine (via GitLab CI).
Ideally, it would automatically use the same unit tests that I have written for my components in /components/mycmp/test/test_mycmp.c, just
like the Unit Test App does.
And if some tests are not appropriate for running on the host, there should be a way to skip them with this test runner.
Ideally it would compile the tests for the host machine to run natively. But I saw that running in qemu is also an option, which is super cool and was easy to try thanks to the provided dockers. The qemu option is described here, but I don't see how to get the test results parsed by the CI.
A related question on SO.
I found these references for host-based testing, but they seem to require your tests to be separated between host_test and target tests.
release-v5.2/esp32/api-guides/host-apps.html
release-v4.4/esp32/api-guides/linux-host-testing.html
It would be great to see a full working example of a trivial project with unit testing working with CI on a host.
Ideally, it would automatically use the same unit tests that I have written for my components in /components/mycmp/test/test_mycmp.c, just
like the Unit Test App does.
And if some tests are not appropriate for running on the host, there should be a way to skip them with this test runner.
Ideally it would compile the tests for the host machine to run natively. But I saw that running in qemu is also an option, which is super cool and was easy to try thanks to the provided dockers. The qemu option is described here, but I don't see how to get the test results parsed by the CI.
A related question on SO.
I found these references for host-based testing, but they seem to require your tests to be separated between host_test and target tests.
release-v5.2/esp32/api-guides/host-apps.html
release-v4.4/esp32/api-guides/linux-host-testing.html
It would be great to see a full working example of a trivial project with unit testing working with CI on a host.
Who is online
Users browsing this forum: No registered users and 221 guests