2

Has anyone used check as the unit test framework in an embedded device which also requires cross-compilation?

Is it even a good idea, or should I just use something else (e.g. embunit or similar)?

If so, how should I write the Makefile.ams and configure.ac? I haven't used autotools to begin with so all this cross-compilation stuff certainly doesn't help...

I could simply skip all the actual configuration checking since I only compile in one or two environments but do I need to compile check to the target? I can't figure from the instructions how to link the actual framework to my test code.

What would be the minimal files that I need? The examples do all the configuration stuff and I can't figure out what I can leave out.

1 Answer 1

1

As far as I can see "check" uses the fork() system call. When you are not using a UNIX-based operating system on your embedded target you shall encounter problems here. On the check manual page in Chapter 2.1 you will find a nice overview of alternative unit testing frameworks. Most frameworks rely on either some operating system calls or some standard library functions which may not be present on your embedded target.

I found macroexpressions unit testing framework MAESTRA very useful on embedded platforms. There was an interesting article on embedded.com some years ago: Doing C code unit testing on a shoestring.

But if you are dealing with lot of third-party code or an existing code base MAESTRA might not be the best choice, for it enforces a special coding standard for code instrumentation to work. This might as well collide with your companies own coding standard.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.