Clean Test is a modern test framework for C++. This accompanying project provides utilities for migrating existing tests to Clean Test.
We enable conversion of standard test registration and assertion macros.
Most importantly this includes a lifting utility that prepares any expression for ct::expect with proper output.
BOOST_TEST(f() == 0 and 1 == g());will be converted to
ct::expect(f() == 0_i and 1_i == g());Use of user-defined literals as well as the clean_test-namespace alias are configurable.
You can install from source via
poetry installThis enables
poetry run migrate -hwhich explains how to use this tool and elaborates all available options.
Existing unit-test frameworks differ significantly from Clean Test. This is why certain constructs only work with or without Clean Test (e.g. fixtures). We don't aim for migrating everything perfectly, but rather for automating the tedious bits of refactoring. Consequently the migrated tests might need small manual adaptations in order to compile.
We currently only support migration from boost-test. Other unit-test frameworks will be added in the future based on the lifting utilities.