This example shows how to combine Catch2 test framework with ESP-IDF console component.
In this example, you can execute test cases from an interactive console on an ESP chip.
To run the example, build and flash the project as usual. For example, with an ESP32 chip:
Bash
idf.py set-target esp32
idf.py build flash monitor
In the console, use test command to invoke Catch2. test accepts the same command line arguments as Catch2 tests on the host:
test -h — prints command line argument referencetest --list-tests — lists all the registered teststest — runs all the registered teststest <test name|pattern|tags> — runs specific testsSee Catch2 documentation for the complete command line argument reference.
To create a project from this example, run:
idf.py create-project-from-example "espressif/catch2=3.4.0~3:catch2-console"