Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:01:00

0001 //  (C) Copyright Gennadiy Rozental 2001.
0002 //  (C) Copyright Beman Dawes 1995-2001.
0003 //  Distributed under the Boost Software License, Version 1.0.
0004 //  (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  See http://www.boost.org/libs/test for the library home page.
0008 //
0009 /// @file
0010 /// @brief Implements main function for Test Execution Monitor.
0011 // ***************************************************************************
0012 
0013 #ifndef BOOST_TEST_TEST_MAIN_IPP_012205GER
0014 #define BOOST_TEST_TEST_MAIN_IPP_012205GER
0015 
0016 // Boost.Test
0017 #include <boost/test/framework.hpp>
0018 #include <boost/test/test_tools.hpp>
0019 #include <boost/test/unit_test_suite.hpp>
0020 
0021 // Boost
0022 #include <boost/cstdlib.hpp>
0023 
0024 #include <boost/test/detail/suppress_warnings.hpp>
0025 
0026 //____________________________________________________________________________//
0027 
0028 extern int test_main( int argc, char* argv[] );    // prototype for user's test_main()
0029 
0030 struct test_main_caller {
0031     test_main_caller( int argc, char** argv ) : m_argc( argc ), m_argv( argv ) {}
0032 
0033     void operator()() {
0034         int test_main_result = test_main( m_argc, m_argv );
0035 
0036         // translate a test_main non-success return into a test error
0037         BOOST_CHECK( test_main_result == 0 || test_main_result == boost::exit_success );
0038     }
0039 
0040 private:
0041     // Data members
0042     int      m_argc;
0043     char**   m_argv;
0044 };
0045 
0046 // ************************************************************************** //
0047 // **************                   test main                  ************** //
0048 // ************************************************************************** //
0049 
0050 ::boost::unit_test::test_suite*
0051 init_unit_test_suite( int argc, char* argv[] ) {
0052     using namespace ::boost::unit_test;
0053 
0054     framework::master_test_suite().p_name.value = "Test Program";
0055 
0056     framework::master_test_suite().add( BOOST_TEST_CASE( test_main_caller( argc, argv ) ) );
0057 
0058     return 0;
0059 }
0060 
0061 //____________________________________________________________________________//
0062 
0063 #include <boost/test/detail/enable_warnings.hpp>
0064 
0065 #endif // BOOST_TEST_TEST_MAIN_IPP_012205GER