|
Boost : |
From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-01-12 09:34:14
On Wed, 12 Jan 2005 09:10:54 -0500
"Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> wrote:
>
> > In my tests, I'd rather not have #ifdef __unix all over the place.
> > Is is possible to add a macro in the Test framework itself that can
> > be checked (on the off chance that timeout support is expanded)?
>
> Why would you want to ifdef it? You don't want to perform specific
> test unless timeout could be catched?
I do not think I was clear enough. Let's look at the example again...
void infinite_loop()
{
// unit test framework can break infinite loops by timeout
#ifdef __unix // don't have timeout on other platforms
BOOST_CHECKPOINT("About to enter an infinite loop!");
while(1);
#else
BOOST_MESSAGE(
"Timeout support is not implemented on your platform");
#endif
}
If I were to write a similar test, I would rather it look something
like...
void infinite_loop()
{
// unit test framework can break infinite loops by timeout
#ifdef BOOST_TEST_HAS_TIMEOUT
BOOST_CHECKPOINT("About to enter an infinite loop!");
while(1);
#else
BOOST_MESSAGE(
"Timeout support is not implemented on your platform");
#endif
}
Also, if I may...
/test/doc/examples/unit_test_example4.html appears to be wrong, as it
makes reference to timeout, but the test code does not appear to use the
timeout facility at all. What am I missing?
Also, in the code for that test, the macro BOOST_PARAM_TEST_CASE is
used. However, I can not find any documentation on how to use it.
Likewise, I can not find documentation on other stuff (the only
reference I can find is the one inside TestTools, but it only covers a
few macros. Where are the docs for the other macros and the test_suite
interface?
FWIW, I am using the HTML docs from the 1.32.0 disctibution.
Thanks!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk