|
Boost Users : |
Subject: Re: [Boost-users] [test framework] one testsuite over multiple translation units
From: Georg Sauthoff (g_sauthoff_at_[hidden])
Date: 2008-12-19 13:15:14
Gennadiy Rozental <rogeeff_at_[hidden]> schrieb:
> Georg Sauthoff <g_sauthoff <at> web.de> writes:
>> Is it possible (and/or intended) to link a set of different testsuites in
>> different translation together to one test executable?
> Yes. It's possible if you are not using single header variant of UTF. Moreover
> you can have the same test suite spawn multiple translation units if you opt to.
> Do you have any specific problems?
Yes, from the documentation I don't see how to do multiple translation
units/testsuites and linking against utf library.
I basically tried this:
//a.cc
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE a
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE( foo )
{
}
//b.cc
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE b
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE( bar )
{
}
//main.cc
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
$ g++ -c a.cc
$ g++ -c b.cc
$ g++ -c main.cc
$ g++ a.o b.o main.o -lboost_unit_test_framework
b.o: In function `main':
b.cc:(.text+0x21c): multiple definition of `main'
a.o:a.cc:(.text+0x21c): first defined here
b.o: In function `init_unit_test()':
b.cc:(.text+0x250): multiple definition of `init_unit_test()'
a.o:a.cc:(.text+0x250): first defined here
main.o: In function `init_unit_test()':
main.cc:(.text+0x0): multiple definition of `init_unit_test()'
a.o:a.cc:(.text+0x250): first defined here
main.o: In function `main':
main.cc:(.text+0x168): multiple definition of `main'
a.o:a.cc:(.text+0x21c): first defined here
collect2: ld returned 1 exit status
Sure, this usage is just a wild guess, extrapolated from the working single
translation unit usage I posted in the original mail. Perhaps I
overlooked it in the boost utf documentation, but I found nothing
specific about this use case there.
Thus, the question is: How to do it right?
Best regards
Georg
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