0

I am a student developing a microcontroller application that uses the Azure RTOS ThreadX, and I never used tests and want to start doing unit testing, integration testing, and automatic tests. I found out the Ceedling and Google Test frameworks, but I would like to know what the community and the ThreadX team uses or recommends to proceed with the tests.

My programming language is C, and I'm using a Cortex M0+.

1 Answers1

0

ThreadX has a custom test suite, specifically written to test and certify the RTOS and middleware.

For your application code on top of the RTOS you can use the suites you mentioned.

I would recommend that in addition to unit-testing you use a static analysis tool or two, to identify other types of problems. During unit-testing and system testing it is also useful to measure code and branch coverage as well as use a profiler to verify performance.

Andrés
  • 51
  • 3
  • Thank you for all your help! Could I simulate the services ThreadX, such as queues, in my tests? Using mocks? I'm thinking of choosing Ceedling because my code base is all C. I thought of gtest because I thought it was "better", what do you suggest? For static analysis, I know Cppcheck, it has the advantage of being free. What do you think? What tools can I use to measure code, branch coverage, and use profiles? I'm very new to this. Do you know tutorials that can I follow or a book? I would like to get an in-depth view of this topic and improve my code base and project workflow. – Marcelo Borges Aug 19 '21 at 10:51
  • You should be able to construct mocks for all the services in ThreadX using any of the frameworks you mentioned. Different frameworks will have different pros and cons; I think that most importantly, there is a balance between capabilities and simplicity. If you are starting out, probably aim for a simpler framework. Another one that you can consider is CUnit. In terms of code coverage and profiling it depends on the toolchain, hardware or simulator, IDE, etc that you are using. I will assume that as a student you are using gcc, then you can look at gcov and gprof. – Andrés Aug 20 '21 at 14:18
  • Yes, I'm a student. I tried Ceedling, and it was really straightforward. I used gcov, and probably I can use the gprof plugin as well. I used ceedling documentations and this [video](https://www.youtube.com/watch?v=QnkO4q95o6s) to start. ​ Thank you for all your help @Andrés ! – Marcelo Borges Aug 21 '21 at 15:17