How does xUnit++ compare to ...?
xUnit++ is far from the only unit testing framework for C++, and is certainly not perfect. However, it stands up quite well when compared to other systems. Most systems utilize preprocessor macros to implement a small subset of checks, and most also require you to provide your own test runner. Perhaps most importantly, only xUnit++ uses
std::async to run tests concurrently!
|xUnit++||Boost UTF||Google Test||MSTest||UnitTest++|
|Implementation||Static Library||Any! (See Note 1.)||User-provided (See Note 2.)||Requires Visual Studio 2012+||Static Library|
|Test Implementation||Member functions||Preprocessor macros||Preprocessor macros||Static member functions||Preprocessor macros|
|Test Runner||Provided||User-supplied||User-supplied||Visual Studio||User-supplied|
|Per-Check Messages||Use an overloaded stream operator.||Append ||Use an overloaded stream operator.||Additional parameter||na|
|Attributes||Up to 8 per test.||n/a||n/a||Unlimited per module, fixture, or method.||n/a|
|Timed Tests||Halt long-running tests.||n/a||n/a||n/a||Fail tests that went over time limit.|
Note 1: Boost has just about every implementation you could ask for. If your test library is small and simple, you can just include a single header file, or you can link it as a static library, or you can reference it as a dynamic library.
Note 2: Google Test requires most users to create a project to build the test executable. Some projects are provided, but several are out of date.
A note on Test Runners: With the exception of MSTest, the other test frameworks require implementing (in some fashion)
int main(). xUnit++ prefers to instead offer standard test runners that know how to run your tests for you natively.