Boost logo

Boost Users :

From: Christopher E Piggott (cepasp_at_[hidden])
Date: 2008-04-17 17:39:31


That's too bad, I like the automatic registration facility because it is less error-prone ... It doesn't allow you to write test cases and not notice that they never get called.

How hard would it be for me to fake it? I wonder if there's some preprocessor trickery that could keep a list, e.g.

#define MY_TEST_CASE( function_name ) \
        #define TEMP LISTOFTESTS, function_name \
      #undef LISTOFTESTS \
        #define LISTOFTESTS TEMP \
        #undef TEMP \
      BOOST_CLASS_TEST_CASE(function_name())

Well I know that obviously won't work but you get the idea ... To wind up with a list that looks like:

        function1, function2, function3,

Which I can then use in an initialized array, and have my test_suite automatically add all of them.

Possible? Good approach or bad?

-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Gennadiy Rozental
Sent: Thursday, April 17, 2008 1:26 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] boost::test timeouts and auto test suites

Christopher E Piggott <cepasp <at> rit.edu> writes:
> Within a
> BOOST_FIXTURE_TEST_CASE can i set a timeout for individual tests?  I'm
> using 1.31.1 and I am aware that a test_unit has a property
> "p_timeout."  I just don't know how to get to it.  I'm using
> BOOST_AUTO_TEST_MAIN, BOOST_AUTO_TEST_SUITE, and a series of BOOST_FIXTURE_TEST_CASE objects.
> Maybe that's just too much auto :)

No. you will have to use manual registration to specify timeout value.

Gennadiy

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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