Boost logo

Boost Test Library Release Notes

Boost release 1.30.0
Migration guide from Boost Test v1

Boost release 1.30.0

  • Facility for automatic registration of unit tests is introduced
    It was requested during original Boost Test review and now it supports automatic registration for free function based test cases. Here an example:
    #include <boost/test/auto_unit_test.hpp>
    
    BOOST_AUTO_UNIT_TEST( test1 )
    {
      BOOST_CHECK( true );
    }
    
    BOOST_AUTO_UNIT_TEST( test2 )
    {
      BOOST_CHECK( true );
    }
  • XML log format is introduced
    Now user willing to automate errors processing could get a log in XML format. Command line switch is introduced that manage log format:
    --log_format=[XML|HRF] will force XML or human readable format respectively
  • XML report format is introduced
    Now user willing to automate results analysis could get a result report in XML format. Command line switch is introduced that manage report format:
    --report_format=[XML|HRF] will force XML or human readable format respectively
  • BOOST_CHECK_NO_THROW test tool is introduced
  • BOOST_BITWISE_CHECK test tool is introduced
  • libraries file names changed to:
    boost_prg_exec_monitor
    boost_test_exec_monitor
    boost_unit_test_framework
  • Components examples and test documentation page is introduced.
    Now all test/examples links lead to this page that has summary information about all of them, that include expected output, type of test and so on
  • Catch system errors switch introduced
    This will work among the lines described in http://lists.boost.org/MailArchives/boost/msg40028.php
    Environment variable name: BOOST_TEST_CATCH_SYSTEM_ERRORS[="no"]
    Unit test framework command line argument: --catch_system_errors[="no"]
  • Added building dynamic libraries into Jamfile
  • MS C runtime debug hooks introduced
    It allows to catch _ASSERT bases assertion for MSVC
  • SIGABRT catch added
  • Eliminated NULLs all over the place
    I switched to use typedef c_string literal instead of char const* and to c_string literal() instead of NULL. Different definition of NULL symbol causing small problems for some compilers
  • class wrapstrstream separated in standalone file and renamed to wrap_stringstream
    For now it will be located in test/detail. Once I prepare doc page for it I will present it for adding into utility
  • unit_test_result_saver introduced to properly managed reset_current_test_set calls in case of exceptions
  • switch back to use scoped_ptr instead of raw test_suite pointer in unit_test_main.cpp
  • BOOST_CPP_MAIN_CONFIRMATION renamed to BOOST_PRG_MON_CONFIRM and changed it's logic a bit
    It now should have value "no" to turn off pass confirmation
  • added tests for auto unit test facility and catching assert statements
  • Jamfile added info examples directory
  • Added example input for the unit_test_example5
  • Command line option --output_format is introduced that both log/report format simultaneously
  • Allows to perform bitwise comparisons of the two arguments provided. Will report as many errors as many bits mismatch. Mismatch position is reported.
  • Documentation default palette changed to white
  • Signal handling selection algorithm fixed
    BOOST_HAS_SIGACTION is used to select sigaction based signal handling alternative. It allowed use of signal handling with gcc on win32 platform.
  • C strings usage in minimized as much as possible
  • class_properties header modified to use Boost.Preprocessor for friends declaration
  • other minor code/doc changes and bug fixes

Boost Test migration guide

This version of Boost.Test library substitute the original testing library used in a Boost. These are several simple steps you need to follow to smoothly migrate to the latest software.

If your code were using the original version of cpp_main facility, to migrate you will need to delete the inclusion of the <boost/test/cpp_main.cpp>, since this file is not present any more. After that you have following choices:

  • Link with Program Execution Monitor (exact library name depends on compiler you are using, but most probably it will be libboost_prg_exec_monitor.lib).
  • Include <boost/test/included/prg_exec_monitor.hpp>, in which case you need not link with precompiled component but it may incur probably some compile time overhead.

If your code were using the original version of test_main and test tools facilitates of Boost.Test library, to migrate to use of latest one you have following choices:

  • Without changing of the code that were using Boost.Test facilities link with Test Execution Monitor (exact library name depends on compiler you are using, but most probably it will be libtest_exec_monitor.lib).
  • Include <boost/test/included/test_exec_monitor.hpp>, in which case you need not link with precompiled component but it may incur probably some compile time overhead. Definition of BOOST_INCLUDE_MAIN could be deleted either.
  • Include <boost/test/minimal.hpp>, in which case you need not link with precompiled component and it most probably does not incur a compile time overhead, but you will be limited ti the set of features defined in the original test library. Definition of BOOST_INCLUDE_MAIN could be deleted either. Would you decide in a future to use any of newer Boost Test features you will be enforced to snitch to one the two chaises above.