Unit Testing in xTimeComposer 14

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
aneves
Experienced Member
Posts: 93
Joined: Wed Sep 16, 2015 2:38 pm

Unit Testing in xTimeComposer 14

Post by aneves »

Hi Everyone,

Has anyone successfully integrated a C/C++ unit testing framework into their xTimeComposer IDE?

A lot of the firmware code I will be writing will be in C/C++ so I was evaluating CppUTest in Visual Studio. I chose CppUTest because it is advertised as being suitable for embedded environments. However, getting it integrated into xTimeComposer is looking like it will be a pain. CppUTest requires you to build the framework into a static library because future test cases you write must be linked to it. While this was trivial in Visual Studio, in xTimeComposer it is quite a chore mainly because it would be very time consuming to generate a makefile for CppUTest that would work in the xmos toolchain.

Looking at the Eclipse Marketplace within xTimeComposer, there is a plugin for Cute C++ Unit Test framework which looks promising but I have not tried it yet.

While finding a unit test framework for C or C++ is (or should) be trivial, what about unit testing xc code? How would one unit test their xc functions from the xmos toolchain?

I hope the answer from the community isn't "we don't unit test"! ;-)


User avatar
aneves
Experienced Member
Posts: 93
Joined: Wed Sep 16, 2015 2:38 pm

Post by aneves »

Anybody? Does anybody know of a unit testing solution for xTimeComposer or the xmos tool chain?
Gothmag
XCore Addict
Posts: 129
Joined: Wed May 11, 2016 3:50 pm

Post by Gothmag »

I've typically just written seperate functions for testing of others and even entire threads and saved relevant data, if any, to an SD. If you did a test you could always print results out after over jtag/xscope but you should make sure to do it at the end, not as you go, since the altered timing won't necessarily provide you the right results.