Boost logo

Boost Users :

From: Alexander Schmolck (a.schmolck_at_[hidden])
Date: 2007-08-13 12:02:06


Hi,

I'm trying to figure out what the best way to use boost.test to achieve
something close to TDD (test driven development) is; I should presumably also
mention that I'm using qmake and not bjam as a build utility.

I've managed to build and use boost.test fine (after figuring out that I
needed to add -DBOOST_TEST_DYN_LINK), but what I haven't been able to achieve
is to

a) have several smaller test-cases/suites for TDD so that I can rapidly
   recompile and run a small subset of tests whilst I'm developing a specific
   class.

b) have one big test-suite, integrating all the above, for regression testing
   to be run periodically (after the above subset of tests passed; on svn
   commit etc.)

I haven't figured out how to set things up so that I can compile individual
tests to .o files and then either simply build a complete regression suite
executable from them or an executable from just one (or a few) of these tests;
because I don't know how to use the autoregistration facilities without ending
up with multiple main()s.

My test files currently look something like this:

//file foo_test.cpp
#define BOOST_TEST_MODULE foo_test
#include <boost/test/unit_test.hpp>
#include "foo.h"

// Test Suite
BOOST_AUTO_TEST_SUITE(foo_test_suite);
BOOST_AUTO_TEST_CASE(some_test_case) {
// ...
}
BOOST_AUTO_TEST_SUITE_END();

What's the recommended way to go about this?

thanks,

'as


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net