I'm writing an external library (a component controller) for use with mbed 5 and plan to make it available in the mbed repositories. I want to write tests to confirm that my code is working properly, but they're just regular ordinary unit tests and don't need to be run on an embedded controller. I'm looking at Catch as my framework, which provides a main
for the test suite.
When I build my project with the mbed
CLI or Eclipse CDT (using an exported project), what .cpp
files are included, and what .o
files are linked into the embedded image? Does the image only include code pulled in from my main.cpp
file via includes, or does it compile and link all of the .cpp
files visible (potentially including my test cases)? If the latter, is there a clean way to exclude them that won't collide with the built-in utest functionality?