sl@0: // (C) Copyright Gennadiy Rozental 2005. sl@0: // Distributed under the Boost Software License, Version 1.0. sl@0: // (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: // See http://www.boost.org/libs/test for the library home page. sl@0: // sl@0: // File : $RCSfile: logged_expectations.hpp,v $ sl@0: // sl@0: // Version : $Revision: 1.2 $ sl@0: // sl@0: // Description : Facilities to perform interaction based testng of logged expectations sl@0: // *************************************************************************** sl@0: sl@0: #ifndef BOOST_TEST_LOGGED_EXPECTATIONS_HPP_120905GER sl@0: #define BOOST_TEST_LOGGED_EXPECTATIONS_HPP_120905GER sl@0: sl@0: // Boost.Test sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: sl@0: //____________________________________________________________________________// sl@0: sl@0: // ************************************************************************** // sl@0: // ************** BOOST_TEST_LOGGED_EXPECTATIONS ************** // sl@0: // ************************************************************************** // sl@0: sl@0: #define BOOST_TEST_LOGGED_EXPECTATIONS( test_name ) \ sl@0: struct test_name : public BOOST_AUTO_TEST_CASE_FIXTURE \ sl@0: { void test_method(); }; \ sl@0: \ sl@0: static void BOOST_AUTO_TC_INVOKER( test_name )() \ sl@0: { \ sl@0: test_name t; \ sl@0: ::boost::itest::logged_expectations( \ sl@0: boost::bind( &test_name::test_method, t ), \ sl@0: BOOST_STRINGIZE(test_name) ".elog", \ sl@0: !::boost::unit_test::runtime_config::save_pattern() ); \ sl@0: } \ sl@0: \ sl@0: struct BOOST_AUTO_TC_UNIQUE_ID( test_name ) {}; \ sl@0: \ sl@0: BOOST_AUTO_TC_REGISTRAR( test_name )( \ sl@0: boost::unit_test::make_test_case( \ sl@0: &BOOST_AUTO_TC_INVOKER( test_name ), #test_name ), \ sl@0: boost::unit_test::ut_detail::auto_tc_exp_fail< \ sl@0: BOOST_AUTO_TC_UNIQUE_ID( test_name )>::value ); \ sl@0: \ sl@0: void test_name::test_method() \ sl@0: /**/ sl@0: sl@0: namespace boost { sl@0: sl@0: namespace itest { sl@0: sl@0: // ************************************************************************** // sl@0: // ************** logged expectations test ************** // sl@0: // ************************************************************************** // sl@0: sl@0: void BOOST_TEST_DECL sl@0: logged_expectations( unit_test::callback0<> const& F, sl@0: unit_test::const_string log_file_name, sl@0: bool test_or_log = true ); sl@0: sl@0: } // namespace itest sl@0: sl@0: } // namespace boost sl@0: sl@0: #include sl@0: sl@0: // *************************************************************************** sl@0: // Revision History : sl@0: // sl@0: // $Log: logged_expectations.hpp,v $ sl@0: // Revision 1.2 2005/12/20 23:50:13 rogeeff sl@0: // unit_test.hpp removed sl@0: // sl@0: // Revision 1.1 2005/12/14 05:09:21 rogeeff sl@0: // interraction based testing is introdused sl@0: // sl@0: // *************************************************************************** sl@0: sl@0: #endif // BOOST_TEST_LOGGED_EXPECTATIONS_HPP_120905GER