Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:09:21

0001 //  (C) Copyright Gennadiy Rozental 2001.
0002 //  Distributed under the Boost Software License, Version 1.0.
0003 //  (See accompanying file LICENSE_1_0.txt or copy at
0004 //  http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 //  See http://www.boost.org/libs/test for the library home page.
0007 //
0008 /// @file
0009 /// @brief Entry point for the end user into the Program Execution Monitor.
0010 ///
0011 /// Use this header to forward declare function prg_exec_monitor_main and to automatically define a main
0012 /// function for you. If you prefer to use your own main you are free to do so, but you need to define
0013 /// BOOST_TEST_NO_MAIN before incuding this header. To initiate your main program body execution you
0014 /// would use statement like this:
0015 /// @code ::boost::prg_exec_monitor_main( &my_main, argc, argv ); @endcode
0016 /// Also this header facilitate auto linking with the Program Execution Monitor library if this feature
0017 /// is supported
0018 // ***************************************************************************
0019 
0020 #ifndef BOOST_PRG_EXEC_MONITOR_HPP_071894GER
0021 #define BOOST_PRG_EXEC_MONITOR_HPP_071894GER
0022 
0023 #include <boost/test/detail/config.hpp>
0024 
0025 //____________________________________________________________________________//
0026 
0027 // ************************************************************************** //
0028 // **************                 Auto Linking                 ************** //
0029 // ************************************************************************** //
0030 
0031 // Automatically link to the correct build variant where possible.
0032 #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_TEST_NO_LIB) && \
0033     !defined(BOOST_PRG_EXEC_MONITOR_NO_LIB) && \
0034     !defined(BOOST_TEST_SOURCE) && !defined(BOOST_TEST_INCLUDED)
0035 #  define BOOST_LIB_NAME boost_prg_exec_monitor
0036 
0037 // If we're importing code from a dll, then tell auto_link.hpp about it:
0038 #  if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_TEST_DYN_LINK)
0039 #    define BOOST_DYN_LINK
0040 #  endif
0041 
0042 #  include <boost/config/auto_link.hpp>
0043 
0044 #endif  // auto-linking disabled
0045 
0046 // ************************************************************************** //
0047 // **************               prg_exec_monitor_main          ************** //
0048 // ************************************************************************** //
0049 
0050 namespace boost {
0051 
0052 /// @brief Wrapper around the main function
0053 ///
0054 /// Call this routine instead of your own main body implementation directly. This routine impements all the monitoring
0055 /// functionality. THe monitor behavior is configurable by using the environment variable BOOST_TEST_CATCH_SYSTEM_ERRORS.
0056 /// If set to string value "no", the monitor will not attempt to catch system errors (signals)
0057 /// @param[in] cpp_main main function body. Should have the same signature as regular main function
0058 /// @param[in] argc, argv command line arguments
0059 int BOOST_TEST_DECL prg_exec_monitor_main( int (*cpp_main)( int argc, char* argv[] ), int argc, char* argv[] );
0060 
0061 } // boost
0062 
0063 #if defined(BOOST_TEST_DYN_LINK) && !defined(BOOST_TEST_NO_MAIN)
0064 
0065 // ************************************************************************** //
0066 // **************        main function for tests using dll     ************** //
0067 // ************************************************************************** //
0068 
0069 // prototype for user's cpp_main()
0070 int cpp_main( int argc, char* argv[] );
0071 
0072 int BOOST_TEST_CALL_DECL
0073 main( int argc, char* argv[] )
0074 {
0075     return ::boost::prg_exec_monitor_main( &cpp_main, argc, argv );
0076 }
0077 
0078 //____________________________________________________________________________//
0079 
0080 #endif // BOOST_TEST_DYN_LINK && !BOOST_TEST_NO_MAIN
0081 
0082 #endif // BOOST_PRG_EXEC_MONITOR_HPP_071894GER