source: NonGTP/Boost/boost/test/impl/unit_test_main.ipp @ 857

Revision 857, 2.7 KB checked in by igarcia, 19 years ago (diff)
Line 
1//  (C) Copyright Gennadiy Rozental 2001-2005.
2//  Distributed under the Boost Software License, Version 1.0.
3//  (See accompanying file LICENSE_1_0.txt or copy at
4//  http://www.boost.org/LICENSE_1_0.txt)
5
6//  See http://www.boost.org/libs/test for the library home page.
7//
8//  File        : $RCSfile: unit_test_main.ipp,v $
9//
10//  Version     : $Revision: 1.6 $
11//
12//  Description : main function implementation for Unit Test Framework
13// ***************************************************************************
14
15#ifndef BOOST_TEST_UNIT_TEST_MAIN_IPP_012205GER
16#define BOOST_TEST_UNIT_TEST_MAIN_IPP_012205GER
17
18// Boost.Test
19#include <boost/test/framework.hpp>
20#include <boost/test/results_collector.hpp>
21#include <boost/test/unit_test_suite.hpp>
22#include <boost/test/results_reporter.hpp>
23
24#include <boost/test/detail/unit_test_parameters.hpp>
25
26// Boost
27#include <boost/cstdlib.hpp>
28
29// STL
30#include <stdexcept>
31#include <iostream>
32
33#include <boost/test/detail/suppress_warnings.hpp>
34
35//____________________________________________________________________________//
36
37// ************************************************************************** //
38// **************                 unit test main               ************** //
39// ************************************************************************** //
40
41int BOOST_TEST_CALL_DECL
42main( int argc, char* argv[] )
43{
44    using namespace boost::unit_test;
45   
46    try {
47        framework::init( argc, argv );
48
49        framework::run();
50
51        results_reporter::make_report();
52
53        return runtime_config::no_result_code()
54                    ? boost::exit_success
55                    : results_collector.results( framework::master_test_suite().p_id ).result_code();
56    }
57    catch( std::logic_error const& ex ) {
58        std::cerr << "Boost.Test internal framework error: " << ex.what() << std::endl;
59       
60        return boost::exit_exception_failure;
61    }
62    catch( ... ) {
63        std::cerr << "Boost.Test internal framework error: unknown reason" << std::endl;
64       
65        return boost::exit_exception_failure;
66    }
67}
68
69//____________________________________________________________________________//
70
71#include <boost/test/detail/enable_warnings.hpp>
72
73// ***************************************************************************
74//  Revision History :
75//
76//  $Log: unit_test_main.ipp,v $
77//  Revision 1.6  2005/02/20 08:27:07  rogeeff
78//  This a major update for Boost.Test framework. See release docs for complete list of fixes/updates
79//
80// ***************************************************************************
81
82#endif // BOOST_TEST_UNIT_TEST_MAIN_IPP_012205GER
Note: See TracBrowser for help on using the repository browser.