os/ossrv/ossrv_pub/boost_apis/boost/test/logged_expectations.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/test/logged_expectations.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,86 @@
     1.4 +//  (C) Copyright Gennadiy Rozental 2005.
     1.5 +//  Distributed under the Boost Software License, Version 1.0.
     1.6 +//  (See accompanying file LICENSE_1_0.txt or copy at 
     1.7 +//  http://www.boost.org/LICENSE_1_0.txt)
     1.8 +
     1.9 +//  See http://www.boost.org/libs/test for the library home page.
    1.10 +//
    1.11 +//  File        : $RCSfile: logged_expectations.hpp,v $
    1.12 +//
    1.13 +//  Version     : $Revision: 1.2 $
    1.14 +//
    1.15 +//  Description : Facilities to perform interaction based testng of logged expectations
    1.16 +// ***************************************************************************
    1.17 +
    1.18 +#ifndef BOOST_TEST_LOGGED_EXPECTATIONS_HPP_120905GER
    1.19 +#define BOOST_TEST_LOGGED_EXPECTATIONS_HPP_120905GER
    1.20 +
    1.21 +// Boost.Test
    1.22 +#include <boost/test/detail/config.hpp>
    1.23 +#include <boost/test/detail/unit_test_parameters.hpp>
    1.24 +#include <boost/test/utils/callback.hpp>
    1.25 +
    1.26 +#include <boost/test/detail/suppress_warnings.hpp>
    1.27 +
    1.28 +//____________________________________________________________________________//
    1.29 +
    1.30 +// ************************************************************************** //
    1.31 +// **************        BOOST_TEST_LOGGED_EXPECTATIONS        ************** //
    1.32 +// ************************************************************************** //
    1.33 +
    1.34 +#define BOOST_TEST_LOGGED_EXPECTATIONS( test_name )                     \
    1.35 +struct test_name : public BOOST_AUTO_TEST_CASE_FIXTURE                  \
    1.36 +{ void test_method(); };                                                \
    1.37 +                                                                        \
    1.38 +static void BOOST_AUTO_TC_INVOKER( test_name )()                        \
    1.39 +{                                                                       \
    1.40 +    test_name t;                                                        \
    1.41 +    ::boost::itest::logged_expectations(                                \
    1.42 +        boost::bind( &test_name::test_method, t ),                      \
    1.43 +        BOOST_STRINGIZE(test_name) ".elog",                             \
    1.44 +        !::boost::unit_test::runtime_config::save_pattern() );          \
    1.45 +}                                                                       \
    1.46 +                                                                        \
    1.47 +struct BOOST_AUTO_TC_UNIQUE_ID( test_name ) {};                         \
    1.48 +                                                                        \
    1.49 +BOOST_AUTO_TC_REGISTRAR( test_name )(                                   \
    1.50 +    boost::unit_test::make_test_case(                                   \
    1.51 +        &BOOST_AUTO_TC_INVOKER( test_name ), #test_name ),              \
    1.52 +    boost::unit_test::ut_detail::auto_tc_exp_fail<                      \
    1.53 +        BOOST_AUTO_TC_UNIQUE_ID( test_name )>::value );                 \
    1.54 +                                                                        \
    1.55 +void test_name::test_method()                                           \
    1.56 +/**/
    1.57 +
    1.58 +namespace boost {
    1.59 +
    1.60 +namespace itest {
    1.61 +
    1.62 +// ************************************************************************** //
    1.63 +// **************           logged expectations test           ************** //
    1.64 +// ************************************************************************** //
    1.65 +
    1.66 +void    BOOST_TEST_DECL
    1.67 +logged_expectations( unit_test::callback0<> const&  F, 
    1.68 +                     unit_test::const_string        log_file_name, 
    1.69 +                     bool                           test_or_log = true );
    1.70 +
    1.71 +} // namespace itest
    1.72 +
    1.73 +} // namespace boost
    1.74 +
    1.75 +#include <boost/test/detail/enable_warnings.hpp>
    1.76 +
    1.77 +// ***************************************************************************
    1.78 +//  Revision History :
    1.79 +//  
    1.80 +//  $Log: logged_expectations.hpp,v $
    1.81 +//  Revision 1.2  2005/12/20 23:50:13  rogeeff
    1.82 +//  unit_test.hpp removed
    1.83 +//
    1.84 +//  Revision 1.1  2005/12/14 05:09:21  rogeeff
    1.85 +//  interraction based testing is introdused
    1.86 +//
    1.87 +// ***************************************************************************
    1.88 +
    1.89 +#endif // BOOST_TEST_LOGGED_EXPECTATIONS_HPP_120905GER