[boost.test] Correct usage?
Hello,
I just started writing unit tests for a large project that I am involved in,
and boost.test has been absolutely fantastic to work with so far. True the
documentation could be clearer, but as far as functionality I am very much
impressed with the library. I have a question though.
I read the following:
http://lists.boost.org/Archives/boost/2011/10/186439.php
This concerns me. What is the status here? When I build boost_1_54_0, in my
stage/lib directory I see:
libboost_test_exec_monitor-vc100-mt-s-1_54.lib
My test cases look as follows:
#define BOOST_TEST_MODULE MyProgram
#include
Philip Bennefall
My test cases look as follows:
#define BOOST_TEST_MODULE MyProgram #include
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
[Please do not mail me a copy of your followup] boost@lists.boost.org spake the secret code <28CFE0BA6A1343FDB715C9C27DD6A3C8@chicken> thusly:
I just started writing unit tests for a large project that I am involved in, and boost.test has been absolutely fantastic to work with so far. True the documentation could be clearer, but as far as functionality I am very much impressed with the library.
I'm in the process of rewriting the documentation. You may find this version more helpful: http://user.xmission.com/~legalize/tmp/boost.test/libs/test/doc/html/ You may also find this tutorial I wrote helpful if you're new to Boost.Test: http://legalizeadulthood.wordpress.com/2009/07/04/c-unit-tests-with-boost-te... http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-te... http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-te... http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-te... http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-te... I use Turtle Mock as a mock object framework which you may also find useful: http://turtle.sourceforge.net/ -- "The Direct3D Graphics Pipeline" free book http://tinyurl.com/d3d-pipeline The Computer Graphics Museum http://computergraphicsmuseum.org The Terminals Wiki http://terminals.classiccmp.org Legalize Adulthood! (my blog) http://legalizeadulthood.wordpress.com
participants (3)
-
Gennadiy Rozental
-
legalize+jeeves@mail.xmission.com
-
Philip Bennefall