unit_test.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // (C) Copyright Gennadiy Rozental 2001.
  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. // See http://www.boost.org/libs/test for the library home page.
  6. //
  7. /// @file
  8. /// @brief Entry point into the Unit Test Framework
  9. ///
  10. /// This header should be the only header necessary to include to start using the framework
  11. // ***************************************************************************
  12. #ifndef BOOST_TEST_UNIT_TEST_HPP_071894GER
  13. #define BOOST_TEST_UNIT_TEST_HPP_071894GER
  14. // Boost.Test
  15. #include <boost/test/test_tools.hpp>
  16. #include <boost/test/unit_test_suite.hpp>
  17. //____________________________________________________________________________//
  18. // ************************************************************************** //
  19. // ************** Auto Linking ************** //
  20. // ************************************************************************** //
  21. #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_TEST_NO_LIB) && \
  22. !defined(BOOST_TEST_SOURCE) && !defined(BOOST_TEST_INCLUDED) && \
  23. defined(BOOST_TEST_MAIN)
  24. # define BOOST_LIB_NAME boost_unit_test_framework
  25. # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_TEST_DYN_LINK)
  26. # define BOOST_DYN_LINK
  27. # endif
  28. # include <boost/config/auto_link.hpp>
  29. #endif // auto-linking disabled
  30. // ************************************************************************** //
  31. // ************** unit_test_main ************** //
  32. // ************************************************************************** //
  33. namespace boost { namespace unit_test {
  34. int BOOST_TEST_DECL unit_test_main( init_unit_test_func init_func, int argc, char* argv[] );
  35. }
  36. // !! ?? to remove
  37. namespace unit_test_framework=unit_test;
  38. }
  39. #if defined(BOOST_TEST_DYN_LINK) && defined(BOOST_TEST_MAIN) && !defined(BOOST_TEST_NO_MAIN)
  40. // ************************************************************************** //
  41. // ************** main function for tests using dll ************** //
  42. // ************************************************************************** //
  43. int BOOST_TEST_CALL_DECL
  44. main( int argc, char* argv[] )
  45. {
  46. return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
  47. }
  48. //____________________________________________________________________________//
  49. #endif // BOOST_TEST_DYN_LINK && BOOST_TEST_MAIN && !BOOST_TEST_NO_MAIN
  50. #endif // BOOST_TEST_UNIT_TEST_HPP_071894GER