comparison DEPENDENCIES/generic/include/boost/test/impl/test_main.ipp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 // (C) Copyright Gennadiy Rozental 2001-2008.
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)
6
7 // See http://www.boost.org/libs/test for the library home page.
8 //
9 // File : $RCSfile$
10 //
11 // Version : $$Revision: 49312 $
12 //
13 // Description : implements main function for Test Execution Monitor.
14 // ***************************************************************************
15
16 #ifndef BOOST_TEST_TEST_MAIN_IPP_012205GER
17 #define BOOST_TEST_TEST_MAIN_IPP_012205GER
18
19 // Boost.Test
20 #include <boost/test/framework.hpp>
21 #include <boost/test/test_tools.hpp>
22 #include <boost/test/unit_test_suite.hpp>
23
24 // Boost
25 #include <boost/cstdlib.hpp>
26
27 #include <boost/test/detail/suppress_warnings.hpp>
28
29 //____________________________________________________________________________//
30
31 extern int test_main( int argc, char* argv[] ); // prototype for user's test_main()
32
33 struct test_main_caller {
34 test_main_caller( int argc, char** argv ) : m_argc( argc ), m_argv( argv ) {}
35
36 void operator()() {
37 int test_main_result = test_main( m_argc, m_argv );
38
39 // translate a test_main non-success return into a test error
40 BOOST_CHECK( test_main_result == 0 || test_main_result == boost::exit_success );
41 }
42
43 private:
44 // Data members
45 int m_argc;
46 char** m_argv;
47 };
48
49 // ************************************************************************** //
50 // ************** test main ************** //
51 // ************************************************************************** //
52
53 ::boost::unit_test::test_suite*
54 init_unit_test_suite( int argc, char* argv[] ) {
55 using namespace ::boost::unit_test;
56
57 framework::master_test_suite().p_name.value = "Test Program";
58
59 framework::master_test_suite().add( BOOST_TEST_CASE( test_main_caller( argc, argv ) ) );
60
61 return 0;
62 }
63
64 //____________________________________________________________________________//
65
66 #include <boost/test/detail/enable_warnings.hpp>
67
68 #endif // BOOST_TEST_TEST_MAIN_IPP_012205GER