Has anyone tried using CppUTest with a Zephyr/nRFConnect SDK based project for unit testing?

I know that Zephyr supports its own test framework ZTest, but I have used CppUTest extensively on past projects.  

I'm also using Quantum Leaps QP (for which there is a Zephyr port) in my project for all of the state machines and there is a nice third party library that is used for testing active objects (cpputest-for-qpc) that requires CppUTest.   What I'd like to do is have a separate build target for testing that would abstract out all hardware specific calls (i.e. gpio, spi, ble, etc..) and pull in CppUTest and cpputest-for-qpc as well as the unit tests as part of that target build. Is this at all possible with the NCS build environment?

Parents
  • Hi

    I could not find anything I'm afraid, so I honestly don't know if it will work. Internally we use twister/ztest where we would mock the hall layer where needed. What could be an option is to build for the Native_simboard if you only want to test your code and don't care about the hardware

    Regards

    Runar

  • Thank you for the reply.  I will investigate if this option will work for me.

  • I hope it will work for you

    Regards

    Runar

Reply Children
No Data