2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
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)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_UNIT_TEST_SUITE_LIST_HPP
11 #define BOOST_BEAST_UNIT_TEST_SUITE_LIST_HPP
13 #include <boost/beast/unit_test/suite_info.hpp>
14 #include <boost/beast/unit_test/detail/const_container.hpp>
15 #include <boost/assert.hpp>
18 #include <unordered_set>
24 /// A container of test suites.
26 : public detail::const_container <std::set <suite_info>>
30 std::unordered_set<std::string> names_;
31 std::unordered_set<std::type_index> classes_;
35 /** Insert a suite into the set.
37 The suite must not already exist.
48 //------------------------------------------------------------------------------
61 s = std::string(library) + "." + module + "." + name;
62 auto const result(names_.insert(s));
63 BOOST_ASSERT(result.second); // Duplicate name
67 auto const result(classes_.insert(
68 std::type_index(typeid(Suite))));
69 BOOST_ASSERT(result.second); // Duplicate type
72 cont().emplace(make_suite_info<Suite>(
73 name, module, library, manual));