Hello,
I am using ESP32 with esp-idf. I found out, that there is possible to add unit tests for components. Is it possible to add unit tests for the main app?
Unit tests for main app
-
dmitrij999
- Posts: 100
- Joined: Sat Mar 02, 2019 8:06 pm
-
dmitrij999
- Posts: 100
- Joined: Sat Mar 02, 2019 8:06 pm
Re: Unit tests for main app
As I understood, the approach putting you logic into one monolite file is NOK, as it becomes hard-to-read.
I propose to divide your code into components, compose Kconfig files for each of components, then your code becomes unit-testable.
P.S. By the way, when I refactored my code and injected unit-tests, I managed to see and solve some unobvious bugs
I propose to divide your code into components, compose Kconfig files for each of components, then your code becomes unit-testable.
P.S. By the way, when I refactored my code and injected unit-tests, I managed to see and solve some unobvious bugs
-
ashelman-ec
- Posts: 9
- Joined: Fri May 13, 2022 6:08 am
Re: Unit tests for main app
FYI all,
For anyone looking for details on how to implement unit tests, refer to Espressif's examples / system / unit_test project.
For those using VS Code with the Espressif IDF extension, refer to this post for details on how to run the tests.
For anyone looking for details on how to implement unit tests, refer to Espressif's examples / system / unit_test project.
For those using VS Code with the Espressif IDF extension, refer to this post for details on how to run the tests.
Re: Unit tests for main app
That example doesn't show how to test code in "main" - it doesn't seem possible.
Is it?
Is it?
Who is online
Users browsing this forum: Bytespider, ChatGPT-User, Google [Bot], meta-externalagent and 7 guests