// // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // Official repository: https://github.com/boostorg/beast // #ifndef BOOST_BEAST_UNIT_TEST_SUITE_LIST_HPP #define BOOST_BEAST_UNIT_TEST_SUITE_LIST_HPP #include #include #include #include #include #include namespace boost { namespace beast { namespace unit_test { /// A container of test suites. class suite_list : public detail::const_container > { private: #ifndef NDEBUG std::unordered_set names_; std::unordered_set classes_; #endif public: /** Insert a suite into the set. The suite must not already exist. */ template void insert( char const* name, char const* module, char const* library, bool manual); }; //------------------------------------------------------------------------------ template void suite_list::insert( char const* name, char const* module, char const* library, bool manual) { #ifndef NDEBUG { std::string s; s = std::string(library) + "." + module + "." + name; auto const result(names_.insert(s)); BOOST_ASSERT(result.second); // Duplicate name } { auto const result(classes_.insert( std::type_index(typeid(Suite)))); BOOST_ASSERT(result.second); // Duplicate type } #endif cont().emplace(make_suite_info( name, module, library, manual)); } } // unit_test } // beast } // boost #endif