[Test] Link succeeds without BOOST_TEST_MAIN defined

The following unexpectedly(?) links and run: --- #include <boost/test/auto_unit_test.hpp> boost::unit_test::test_suite* init_unit_test_suite( int, char*[] ) { boost::unit_test::framework::master_test_suite().p_name.value = "whatever"; return 0; } --- Don't I need to define BOOST_TEST_MAIN in this case? Is this as intended? I'm using the latest cvs and UTF as a static library. // Johan

The following unexpectedly(?) links and run: --- #include <boost/test/auto_unit_test.hpp>
boost::unit_test::test_suite* init_unit_test_suite( int, char*[] ) { boost::unit_test::framework::master_test_suite().p_name.value = "whatever"; return 0; } ---
Don't I need to define BOOST_TEST_MAIN in this case? Is this as intended? I'm using the latest cvs and UTF as a static library.
The only purpose of BOOST_TEST_MAIN for regular build is to define this init function. So obviously this is working. Gennadiy

| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental | Sent: 03 February 2006 16:23 | To: boost@lists.boost.org | Subject: Re: [boost] [Test] Link succeeds without | BOOST_TEST_MAIN defined | | > The following unexpectedly(?) links and run: | > --- | > #include <boost/test/auto_unit_test.hpp> | > | > boost::unit_test::test_suite* | > init_unit_test_suite( int, char*[] ) | > { | > boost::unit_test::framework::master_test_suite().p_name.value = | > "whatever"; | > return 0; | > } | > --- | > | > Don't I need to define BOOST_TEST_MAIN in this case? Is | this as intended? | > I'm using the latest cvs and UTF as a static library. | | The only purpose of BOOST_TEST_MAIN for regular build is to | define this init | function. So obviously this is working. so is the effect of BOOST_TEST_MAIN to define, with the name "Master Test suite" | > boost::unit_test::test_suite* | > init_unit_test_suite( int, char*[] ) | > { | > boost::unit_test::framework::master_test_suite().p_name.value = | > "Master test suite"; | > return 0; | > } If so, it might be worth saying just this. But if I write #define BOOST_TEST_MAIN "My Test suite" I might naively expect it to be be logged as Test suite "My Test Suite" failed with: ..... But this doesn't seem to happen. Perhaps it easily could? Paul PS not able to FTP suck code from your machine today. Maybe it has a rest on Sunday? ;-) -- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204 mailto: pbristow@hetp.u-net.com http://www.hetp.u-net.com/index.html http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html

| The only purpose of BOOST_TEST_MAIN for regular build is to | define this init | function. So obviously this is working.
so is the effect of BOOST_TEST_MAIN to define, with the name "Master Test suite"
I did not want to give the same macro to different distinct purposes. But after some considerations I've reinstanted the ability to name a master test suite with macro. Different macro though: BOOST_TEST_MODULE
Paul
PS not able to FTP suck code from your machine today. Maybe it has a rest on Sunday? ;-)
I may need to reenable it. Lets try to contact using Google Talk Gennadiy

OK I've now got a lot of files - looks like they are your latest and greatest. Will work on it tomorrow Thanks Paul | -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental | Sent: 05 February 2006 18:31 | To: boost@lists.boost.org | Subject: Re: [boost] [Test] Link succeeds without | BOOST_TEST_MAIN defined | | > | The only purpose of BOOST_TEST_MAIN for regular build is to | > | define this init | > | function. So obviously this is working. | > | > | > so is the effect of BOOST_TEST_MAIN to define, with the | name "Master Test | > suite" | | I did not want to give the same macro to different distinct | purposes. But | after some considerations I've reinstanted the ability to | name a master test | suite with macro. Different macro though: BOOST_TEST_MODULE | | | > Paul | > | > PS not able to FTP suck code from your machine today. | Maybe it has a rest | > on Sunday? ;-) | | I may need to reenable it. Lets try to contact using Google Talk | | Gennadiy | | | | _______________________________________________ | Unsubscribe & other changes: | http://lists.boost.org/mailman/listinfo.cgi/boost |

Gennadiy Rozental wrote: [snip]
Don't I need to define BOOST_TEST_MAIN in this case? Is this as intended? I'm using the latest cvs and UTF as a static library.
The only purpose of BOOST_TEST_MAIN for regular build is to define this init function. So obviously this is working.
For me, BOOST_TEST_MAIN sounds like one is defining a "main" function. I guess this relates to the naming issue we discussed earlier. I saw your posting about BOOST_TEST_MODULE, which sounds better. // Johan

For me, BOOST_TEST_MAIN sounds like one is defining a "main" function. I guess this relates to the naming issue we discussed earlier. I saw your posting about BOOST_TEST_MODULE, which sounds better.
BOOST_TEST_MAIN mark one of the files as main in multifiles test module. But it does not affect the master test suite name. BOOST_TEST_MODULE names master test suite and also enforce BOOST_TEST_MAIN since only one "main" file could name the master test suite. Gennadiy

| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental | Sent: 08 February 2006 15:05 | To: boost@lists.boost.org | Subject: Re: [boost] [Test] Link succeeds without | BOOST_TEST_MAIN defined | | > For me, BOOST_TEST_MAIN sounds like one is defining a | "main" function. I | > guess this relates to the naming issue we discussed | earlier. I saw your | > posting about BOOST_TEST_MODULE, which sounds better. | | BOOST_TEST_MAIN mark one of the files as main in multifiles | test module. But | it does not affect the master test suite name. | BOOST_TEST_MODULE names | master test suite and also enforce BOOST_TEST_MAIN since only | one "main" | file could name the master test suite. So would BOOST_TEST_MODULE be better named BOOST_TEST_MASTER_SUITE? (And if no parameter provided, then it is called "Master Test Suite" But if BOOST_TEST_MASTER_SUITE "My Test Master Suite" then called My Test Master Suite Or am I still confused? Paul -- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204 mailto: pbristow@hetp.u-net.com http://www.hetp.u-net.com/index.html http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html

| BOOST_TEST_MAIN mark one of the files as main in multifiles | test module. But | it does not affect the master test suite name. | BOOST_TEST_MODULE names | master test suite and also enforce BOOST_TEST_MAIN since only | one "main" | file could name the master test suite.
So would BOOST_TEST_MODULE be better named BOOST_TEST_MASTER_SUITE?
(And if no parameter provided, then it is called "Master Test Suite"
But if
BOOST_TEST_MASTER_SUITE "My Test Master Suite"
then called My Test Master Suite
Or am I still confused?
Paul
I prefer shorter names. Test module name is equivalent for the master test suite name. Gennadiy

| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennadiy Rozental | Sent: 08 February 2006 16:58 | To: boost@lists.boost.org | Subject: Re: [boost] [Test] Link succeeds without | BOOST_TEST_MAIN defined | | > | BOOST_TEST_MAIN mark one of the files as main in multifiles | > | test module. But | > | it does not affect the master test suite name. | > | BOOST_TEST_MODULE names | > | master test suite and also enforce BOOST_TEST_MAIN since only | > | one "main" | > | file could name the master test suite. | > | > So would BOOST_TEST_MODULE be better named BOOST_TEST_MASTER_SUITE? | > | > (And if no parameter provided, then it is called "Master Test Suite" | > | > But if | > | > BOOST_TEST_MASTER_SUITE "My Test Master Suite" | > | > then called My Test Master Suite | > | > Or am I still confused? | > | > Paul | | I prefer shorter names. Test module name is equivalent for | the master test suite name. OK, but will it allow one to NAME the master test suite? Paul PS Talking of names I don't really like BOOST_CHECK_SMALL and IMO it should be BOOST_CHECK_SMALLER (only 2 letters longer ;¬) because it is really an absolute less_than function (MACRO).
>>>>>>>>>> EVERYONE : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Is anyone actually using this function yet???? Could we change its name without distress? -- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204 mailto: pbristow@hetp.u-net.com http://www.hetp.u-net.com/index.html http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html

| I prefer shorter names. Test module name is equivalent for | the master test suite name.
OK, but will it allow one to NAME the master test suite?
I am not sure what you mean. BOSOT_TEST_MODULE gives single name to the test module - the name of the master test suite.
Paul
PS Talking of names I don't really like
BOOST_CHECK_SMALL
and IMO it should be BOOST_CHECK_SMALLER
(only 2 letters longer ;¬)
because it is really an absolute less_than function (MACRO).
Not really. BOOST_CHECK_SMALL( a, t ) checks that absolute value of a is small. Specifically it checks that |a| < t. Name seems correct IMO. Gennadiy
participants (3)
-
Gennadiy Rozental
-
Johan Nilsson
-
Paul A Bristow