My tests look roughly like this:
#include <boost/test/unit_test.hpp>#define BOOST_TEST_MAINBOOST_AUTO_TEST_CASE( foo_test ){ BOOST_CHECK(2+2 == 4);}BOOST_AUTO_TEST_CASE( bar_test){ BOOST_CHECK_NO_THROW(dostuff());}
And if you want to use a fixture in one of your tests:
struct fixture_class { fixture_class() : some_member(42) { // perform set-up for the test } ~fixture_class() { // perform any necessary tear-down after the test } int some_member;};BOOST_FIXTURE_TEST_CASE( test_name , fixture_class ){ BOOST_CHECK(some_member == 42);}
I agree, it becomes a major pain if you start fiddling with manually registering your tests in test suites and all that. But as long as you stick with the automatically-registered ones, it doesn't require a lot of work to use. (Then again, I haven't used CppUnitLite, so can't really compare).
Not trying to "convert" anyone though, just curious because if it turns out other frameworks are easier still, I might as well use one of those instead. [grin]