Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost] [Test] [1.38] "can't use testing tools before framework is initialized"
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-06-06 02:47:52


Greg Christopher wrote:
> FYI- still looking for help on this execution issue- sample code is posted as requested:

I've checked in 3 different examples of external function main usage
into examples directory. Here is one:

#ifndef BOOST_TEST_DYN_LINK
#define BOOST_TEST_DYN_LINK
#endif
#include <boost/test/unit_test.hpp>
using namespace boost::unit_test;

//____________________________________________________________________________//

BOOST_AUTO_TEST_SUITE( test_suite_1 )

BOOST_AUTO_TEST_CASE( test_case_1 )
{
      BOOST_MESSAGE( "Testing is in progress" );

      BOOST_CHECK( false );
}

BOOST_AUTO_TEST_SUITE_END()

//____________________________________________________________________________//

bool
init_function()
{
     // do your own initialization here
     // if it successful return true

     // But, you CAN'T use testing tools here
     return true;
}

//____________________________________________________________________________//

int
main( int argc, char* argv[] )
{
     return ::boost::unit_test::unit_test_main( &init_function, argc,
argv );
}

//____________________________________________________________________________//

This examples compiles and works fine with at least gcc msvc-8.0 and
msvc-7.1.

Gennadiy


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