Test on Your Host Computer as Much as Possible

The target computer is a fun toy, and once it starts working, it seems to be the natural place to do all of your testing. After all, that’s where the software has to run eventually—why not test it there?

That reasoning is invalid. You should test as much of your software as possible on your host computer system. If your host is running a different processor, modify your Makefiles so that the software can be built for your host or target. If your software depends on hardware that can only be found in the target, you can still test a lot of your code on the host by #ifdef -ing out the parts of the code that actually need the target’s hardware.

Testing your software on your host is important for these ...

Get Embedded Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.