Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2008-01-11 13:50:46


Benoit Sigoure <tsuna <at> lrde.epita.fr> writes:
> Would it be possible for you to give me the smallest dumb code that
> exercises the most basic feature of Boost.Test + compilation and
> linkage against Boost.Test?

Test for single header variant; no need to link with the library:

#define BOOST_TEST_MODULE boost.m4
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE( case )
{
   BOOST_ERROR( "expected" );
}

---------------------

Standalone library variants:

#define BOOST_TEST_MODULE boost.m4
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_CASE( case )
{
   BOOST_ERROR( "expected" );
}

This should work both for static and shared library variants. In later case
you need to add BOOST_TEST_DYN_LINK to the compiler options and corresponding
link options to enforce linking with shared library.

Some specific features of Boost.Test (like floating point comparisons) require
additional headers. We can come up with corresponding tests as well.

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk