Boost logo

Boost :

Subject: Re: [boost] [boost.test] Correct usage?
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2013-09-04 00:40:31


Philip Bennefall <philip <at> blastbay.com> writes:

> My test cases look as follows:
>
> #define BOOST_TEST_MODULE MyProgram
> #include <boost/test/unit_test.hpp>
>
> BOOST_FIXTURE_TEST_SUITE(basic_operations, basic_memory_logger)
>
> BOOST_AUTO_TEST_CASE( some_test )
> {
> // ...
> // Using BOOST_REQUIRE_EQUAL, BOOST_CHECK_EQUAL, BOOST_CHECK,
> BOOST_REQUIRE_EQUAL_COLLECTIONS and friends here.
> }
>
> BOOST_AUTO_TEST_SUITE_END()
>
> My questions are:
> 1. Are all these macros still supported and not deprecated?
>
> 2. Is the structure correct? Am I depending on something deprecated? Am I
> including the right header? I am linking with the library mentioned above
> (via auto-linking), which is why I am concerned about deprecation.

1. Test Execution Monitor is indeed deprecated
2. You do not need Test Execution Monitor - you need Unit Test Framework
3. If you include unit_test.hpp, auto linking will bring
unit_test_framework. I can't see how you could have linked with the other
lib.
4. All the macros above are still working. There is a plan to introduce new
macro which might replace some of them, but there is no definite plan yet
when and if these are going to be deprecated (they will continue to work for
a long time in a any case).
5. You usage of all macros is correct. You will work fine once you link with
unit test framework

HTH,
Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk