There are a large number of C and C++ test frameworks,
differing in slight ways.
See ConsiderationsForAndComparisonOfCeePlusPlusTestFrameworks.
For CeePlusPlus:
- CppUnit
- Which CppUnit to use? Michael Feather's original, the one on SourceForge, the one in Debian, the one in Freshmeat, ...
- Is SourceForge's the canonical cross platform portable CppUnit?
- Platform specific versions
- And some versions that innovated in ways that may be, or may have already been, incorporated in the standard CppUnit
- Frameworks inspired by CppUnit that seem quite different in flavour
- Frameworks that seem only loosely related to CppUnit
- Independent implementations
For
CeeLanguage:
There are many more if you
GoogleSearch.
Why so many?
Why isn't one good enough, and be done with it?
Proliferation is not necessarily a bad thing. Different people have different needs. Having a bunch of packages that do the same thing is wasted effort, but the packages don't all do the same thing.
Some good reasons for different packages:
- Compiler incompatibilities. There are lots of C++ compilers and supporting libraries with various levels of non-conformance to current and past standards. Writing one framework to support all of those is a lot of work, and leads to lowest-common-denominator functionality.
- Platform incompatibilities. C++ programs are often written to take advantage of specific operating-system APIs. Each API has its own set of rules for what constitutes an error. Each API has its own way of generating printed and graphical output. A platform-independent test framework cannot take advantage of these features.
- Ancestry. CppUnit is the most mature framework, but some would say it suffers from being too closely based upon JUnit. CppUtx and CxxTest are based on C++ idioms.
- Programming Styles. C++ supports a lot of different ways of writing programs. People who use lots of templates might want features in a test framework that are very different from those who resist using templates. Similarly, people who use C++ as "a better C" might not want to use inheritance and other OO features when writing their tests.
If all the frameworks can be refactored down to one framework, without losing important features, then that would be a good thing. If it turns into an everything-but-the-kitchen-sink monstrosity, then I expect people to stay with the simpler frameworks.
You beat me to it - adding a list of reasons for the proliferation while I was out househunting.
Agreed: proliferation and diversity are not necessarily bad. Actually, I started out wanting to call this page ConsiderationsForAndComparisonOfCeePlusPlusTestFrameworks --- all I wanted to do was to compare their features, so I could decide which one I wanted to use. I thought that recording such a comparison might be useful - certainly, I would love to see one.
I've carried my own minimalist C, and then C++, test framework around since 1980. I've started to grow jealous of features I see in other test frameworks. I wanted to do some comparisons before I decided which to use.
I have modified a few of the items listed above.
CategoryTesting CategoryCpp CategoryFramework