unit_test.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. # define BOOST_LIB_NAME boost_unit_test_framework
  24. # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_TEST_DYN_LINK)
  25. # define BOOST_DYN_LINK
  26. # endif
  27. # include <boost/config/auto_link.hpp>
  28. #endif // auto-linking disabled
  29. // ************************************************************************** //
  30. // ************** unit_test_main ************** //
  31. // ************************************************************************** //
  32. namespace boost { namespace unit_test {
  33. int BOOST_TEST_DECL unit_test_main( init_unit_test_func init_func, int argc, char* argv[] );
  34. }
  35. // !! ?? to remove
  36. namespace unit_test_framework=unit_test;
  37. }
  38. #if defined(BOOST_TEST_DYN_LINK) && defined(BOOST_TEST_MAIN) && !defined(BOOST_TEST_NO_MAIN)
  39. // ************************************************************************** //
  40. // ************** main function for tests using dll ************** //
  41. // ************************************************************************** //
  42. int BOOST_TEST_CALL_DECL
  43. main( int argc, char* argv[] )
  44. {
  45. return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
  46. }
  47. //____________________________________________________________________________//
  48. #endif // BOOST_TEST_DYN_LINK && BOOST_TEST_MAIN && !BOOST_TEST_NO_MAIN
  49. #endif // BOOST_TEST_UNIT_TEST_HPP_071894GER