Is there a unit testing framework for "plain C", which can easily be integrated with the Visual Studio Test Explorer?
Since I would like to introduce unit testing to our firmware/embedded team in a similar way we are doing for .NET apps, my primary concern is user friendliness, i.e. it has to be simple to write a test and get the green light inside the test explorer.
I am aware of the Microsoft Unit Testing Framework for C++, but since the team has no experience with C++, I am unsure if this will go smoothly. According to the author of Criterion in this HN thread:
Because C hasn't been a subset of C++ since C99, there are plenty of case where trying to do C in C++ is awkward or just not possible with standard C++:
First, you'd have to wrap your header inclusions in
extern "C"
to disable mangling, then you would have to make sure you static_cast all your pointers where normallyvoid*
conversions would have done its job.Furthermore, all interfaces relying on designated initializers and compound literals are broken unless you decide to compile in nonstandard GNU C++.
And there are more incompatibilities, such as using
static
orconst
in array parameter declarations or using VLA in macros which are not recognized by C++.
Second concern is integration with our CI server (Bamboo), but I don't expect any problems there once it's running.