On Mon, Sep 15, 2008 at 4:22 PM, Markus Schöpflin <markus.schoepflin@comsoft.de> wrote:
Ovanes Markarian wrote:

I guess I forgot to mention that I need to configure the fixture at
runtime. The DB name (which is actually a connection string) is passed to
the test as a command line parameter.

Just implement in your fixture a protected member called init_db(string_type
const& db_name);

This member can be called from the suite's body, since AFAIK it derives from
it.

But hasn't the fixture already been constructed then? So using the constructor of the fixture for setting up the DB connection will not be possible. Or did I get you wrong?

Thanks for your help,

Markus

Yes, but who said, that you must use the constructor for connection initialization? You can also go another way and have you suite without fixture specification, but initialize the fixture in the first line of your suite:

BOOST_TEST_....()
{
   Fixture f(pass the name of db connection);
}

Best Regards,
Ovanes