unit_test_example_09_2.cpp 1012 B

12345678910111213141516171819202122232425262728293031323334
  1. // (C) Copyright Gennadiy Rozental 2005-2014.
  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. // Boost.Test
  7. // only one file should define BOOST_TEST_MAIN/BOOST_TEST_MODULE
  8. #include <boost/test/unit_test.hpp>
  9. // STL
  10. #include <iostream>
  11. //____________________________________________________________________________//
  12. struct MyConfig2 {
  13. MyConfig2() { std::cout << "global setup part2\n"; }
  14. ~MyConfig2() { std::cout << "global teardown part2\n"; }
  15. };
  16. // structure MyConfig2 is used as a global fixture. You could have any number of global fxtures
  17. BOOST_TEST_GLOBAL_FIXTURE( MyConfig2 );
  18. //____________________________________________________________________________//
  19. BOOST_AUTO_TEST_CASE( my_test2 )
  20. {
  21. BOOST_CHECK( true );
  22. }
  23. //____________________________________________________________________________//
  24. // EOF