global_suites.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/beast
  8. //
  9. #ifndef BOOST_BEAST_UNIT_TEST_GLOBAL_SUITES_HPP
  10. #define BOOST_BEAST_UNIT_TEST_GLOBAL_SUITES_HPP
  11. #include <boost/beast/_experimental/unit_test/suite_list.hpp>
  12. namespace boost {
  13. namespace beast {
  14. namespace unit_test {
  15. namespace detail {
  16. /// Holds test suites registered during static initialization.
  17. inline
  18. suite_list&
  19. global_suites()
  20. {
  21. static suite_list s;
  22. return s;
  23. }
  24. template<class Suite>
  25. struct insert_suite
  26. {
  27. insert_suite(char const* name, char const* module,
  28. char const* library, bool manual)
  29. {
  30. global_suites().insert<Suite>(
  31. name, module, library, manual);
  32. }
  33. };
  34. } // detail
  35. /// Holds test suites registered during static initialization.
  36. inline
  37. suite_list const&
  38. global_suites()
  39. {
  40. return detail::global_suites();
  41. }
  42. } // unit_test
  43. } // beast
  44. } // boost
  45. #endif