1 // (C) Copyright Gennadiy Rozental 2001.
2 // (C) Copyright Beman Dawes 1995-2001.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/test for the library home page.
10 /// @brief Implements main function for Test Execution Monitor.
11 // ***************************************************************************
13 #ifndef BOOST_TEST_TEST_MAIN_IPP_012205GER
14 #define BOOST_TEST_TEST_MAIN_IPP_012205GER
17 #include <boost/test/framework.hpp>
18 #include <boost/test/test_tools.hpp>
19 #include <boost/test/unit_test_suite.hpp>
22 #include <boost/cstdlib.hpp>
24 #include <boost/test/detail/suppress_warnings.hpp>
26 //____________________________________________________________________________//
28 extern int test_main( int argc, char* argv[] ); // prototype for user's test_main()
30 struct test_main_caller {
31 test_main_caller( int argc, char** argv ) : m_argc( argc ), m_argv( argv ) {}
34 int test_main_result = test_main( m_argc, m_argv );
36 // translate a test_main non-success return into a test error
37 BOOST_CHECK( test_main_result == 0 || test_main_result == boost::exit_success );
46 // ************************************************************************** //
47 // ************** test main ************** //
48 // ************************************************************************** //
50 ::boost::unit_test::test_suite*
51 init_unit_test_suite( int argc, char* argv[] ) {
52 using namespace ::boost::unit_test;
54 framework::master_test_suite().p_name.value = "Test Program";
56 framework::master_test_suite().add( BOOST_TEST_CASE( test_main_caller( argc, argv ) ) );
61 //____________________________________________________________________________//
63 #include <boost/test/detail/enable_warnings.hpp>
65 #endif // BOOST_TEST_TEST_MAIN_IPP_012205GER