Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] [1.38] Automated test suite registration with muti-file-test-modules
From: Greg Christopher (gchristopher_at_[hidden])
Date: 2009-07-08 13:01:50


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
> Sent: Friday, July 03, 2009 11:48 PM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [Boost.Test] [1.38] Automated test suie
> registration with muti-file-test-modules
>
> Greg Christopher <gchristopher <at> vmware.com> writes:
>
> > > This is covered in docs I believe. BOOST_TEST_MODULE has similar
> effect
> > > as
> > > BOOST_TEST_MAIN, but also define the name of the master test suite
> >
> > Since I don't really need to define the name of the master test
> suite,
> > I will not use BOOST_TEST_MODULE.
> >
> > As it turns out, that still does not yield a working example. I then
> > have no init_unit_test_suite()
>
> Please post an example and how you build it.

The example is basically the same example that was posted earlier:
Test1.cpp:
#include "stdafx.h"

#define BOOST_TEST_MAIN Yes // Remove this line and we stop working

#include <boost/test/execution_monitor.hpp>
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_SUITE(foo1)

BOOST_AUTO_TEST_CASE(foo1case)
{
     BOOST_CHECK(4 == 4);
}

BOOST_AUTO_TEST_SUITE_END()
Test2.cpp
#include "stdafx.h"

#include <boost/test/execution_monitor.hpp>
#include <boost/test/unit_test.hpp>

#define BOOST_TEST_MODULE Yeah

BOOST_AUTO_TEST_SUITE(foo2)

BOOST_AUTO_TEST_CASE(foo2case)
{
    BOOST_CHECK(4 == 4);
}

BOOST_AUTO_TEST_SUITE_END()

        Now when you link to the static version of the lib you get this:

1>libboost_unit_test_framework-vc90-mt-gd-1_38.lib(unit_test_main.obj) : error LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite_at_unit_test_at_boost@@HQAPAD_at_Z) referenced in function _main

Project is a simple Visual Studio 2008 one using static version of boost:

http://www.easy-share.com/1906667710/basic.zip

Thanks,
Greg


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