|
Boost : |
From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-12-22 10:44:18
> I've been trying out the auto-test items in Boost.Test, re-doing them when
> the recent changes were uploaded to CVS. I decided to template-ize a test
> case I had, going from BOOST_AUTO_TEST_CASE to
> BOOST_AUTO_TEST_CASE_TEMPLATE
> with a MPL list of the types I wanted. The complier spit out 10 errors.
> (I
> think that's a lot, but for some posters here that's a little.) After
> using
> the preprocessor to copy & paste the expansion of
> BOOST_AUTO_TEST_CASE_TEMPLATE directly into my test file, I narrowed down
> the errors to two actual problems:
>
> 1. The compiler never heard of boost::type
> 2. And it never heard of boost::unit_test::ut_detail::
> template_test_case_gen
>
> These can be found in the <boost/type.hpp> (after 10 minutes of searching)
> and <boost/test/test_case_template.hpp> (after 30 minutes of searching)
> headers, respectively. Directly #including them in my test file got my
> testing to work.
>
> The simple solution is to make sure to _directly_ include the headers for
> the items you need to compile....
>
> [Does some checking of the auto-test examples.]
>
> The example for BOOST_AUTO_TEST_CASE_TEMPLATE shows that
> <boost/test/test_case_template.hpp> needs to be manually #included. This
> is
BOOST_AUTO_TEST_CASE_TEMPLATE does require to be manually included. I've
decided to follow "Don't pay for something you are not using" principle. If
there is a general consensus I could include this header into unit_test.hpp.
boost/type.hpp is included in boost/test/test_case_template.hpp, so you
shouldn't have any problems.
Gennadiy
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk