I am evaluating which testing framework would be ideal for me.
The choice is among these three: google test
, boost.test
and catch
.
I would like something robust that has not so many dependencies and that is able to support C++14/C++17 if needed.
Another question, do you know which framework big companies in the avionics/space fields use?
Google test, or gtest is an open source framework for unit testing C\C++ projects.
Google C++ Mocking Framework (or Google Mock for short) is a library (sometimes we also call it a “framework” to make it sound cool) for creating mock classes and using them. It does to C++ what jMock and EasyMock do to Java.
Google Test is not header-only: there are libraries to build. So, as a Visual Studio user, you have essentially two options.
If you have a broken test that you cannot fix right away, you can add the DISABLED_ prefix to its name. This will exclude it from execution. This is better than commenting out the code or using #if 0 , as disabled tests are still compiled (and thus won't rot).
I would like something robust that has not so many dependencies and that is able to support c++14/c++17 if needed.
Google C++ test framework requirements mention:
A C++98-standard-compliant compiler
It works just fine with C++14, I personally use it. From the linked documentation you can see that it has no dependencies on external libraries (see section requirements).
Catch known limitations mention:
our desire to support C++98 compilers
It works just fine with C++14, I personally used it in a couple of projects at work. Catch is a header only library, it has no dependencies at all.
Boost C++ libraries usually perform compile-time detection of compiler support for the standards and features are enabled/disabled depending on the result.
As a rule of thumb, those libraries usually depend on some other libraries picked up from Boost itself.
do you know which framework big companies in the avionics/space fields use?
Often they require not only to write tests but also to have a code coverage estimation. There are a plenty of professional tools for that, few of them are for free and (at least, as long as I know) there doesn't exist a standard de facto for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With