Unit testing with Unity in MCUXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unit testing with Unity in MCUXpresso

2,488 Views
scottm
Senior Contributor II

Is anyone using Unity or a similar framework for unit testing within MCUXpresso?

I realize there's no full-chip simulation available.  What I'm after at the moment is just the ability to test pure functions on the host system, probably under MinGW.  I've demonstrated that I can run Unity tests in MCUX in a project created to use the MinGW toolchain, and it looks like I can set up a build configuration in a Kinetis project to use MinGW, but I figure it might be asking for trouble to mix things like that if it's not something NXP is testing and the managed make system might be difficult to work with.

Worst case, I could just set up my unit tests entirely separate from the MCUX project and kick them off as an external tool.  I would prefer to be able to maintain my tests side by side with the actual code, switch back and forth between the two easily, and run the tests and see results easily.  There are some Eclipse plugins that might work for some of that.

Maybe someone at NXP could explain how the managed make system works?  That might make it easier to figure out how to get it to play nice with a unit test framework.

Thanks!

Labels (1)
Tags (1)
4 Replies

2,048 Views
Gamka
Contributor III

Hi! 
 I am quite new to unit testing in embedded environment. I am using MCUXpresso with mimxrt1064. Could you instruct me where to get started in the configuration? What kind of changes you had to make to make Unity&Ceedling work?
Br, Kaisa

0 Kudos

2,167 Views
amit_rao
Contributor I

Hi Scott scottmiller

I'm interested in doing this too; have you set something up? What unit testing framework are you considering? I've started to look into Unity.

Thanks,

Amit

0 Kudos

2,167 Views
amit_rao
Contributor I

I've been able to set up ceedling which uses unity to do unit testing on a MKL82Z128, with a project in MCUXpresso. This would allow me to do "test driven development" although now I am just using it after the fact.

There were a few changes I needed to make to the NXP source files, but now I have my project compiling for x86 and I can run my code on my development machine.

I haven't used any other unit testing frameworks, but ceedling (Throw The Switch ) seems suitable

Amit

0 Kudos

153 Views
ajain33555
Contributor I

how did you accomplish using ceedling with your embedded project. can you share the details? Thanks!

0 Kudos