I am writing a component in C++ and I would like to test it. So according to the documentation, I created a directory test and wrote a simple test there in a .c file. How should I now run the test of my component using unit-test-app?
Also, I have noticed there some tests written in the Catch framework, which is included in ESP-IDF. How can I use it to write C++ tests of my component?
Writing tests for a component
Re: Writing tests for a component
Hi,
I've wrote some C unit test cases according to the doc http://esp-idf.readthedocs.io/en/latest ... tests.html.
after adding cases, you need to do `make flash TESTS_ALL=1` or `make TEST_COMPONENTS='xxx'` to build unit-test-app and flash to target board. then open the serial console, reboot the board, it will print the test menu which contains all built test cases.
then input index of test case in test menu, or quoted test case name ("test case name"), plus Enter, it will run the case and report test result.
I've wrote some C unit test cases according to the doc http://esp-idf.readthedocs.io/en/latest ... tests.html.
after adding cases, you need to do `make flash TESTS_ALL=1` or `make TEST_COMPONENTS='xxx'` to build unit-test-app and flash to target board. then open the serial console, reboot the board, it will print the test menu which contains all built test cases.
then input index of test case in test menu, or quoted test case name ("test case name"), plus Enter, it will run the case and report test result.
Who is online
Users browsing this forum: No registered users and 320 guests