2 // Copyright (c) 2013-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)
8 #ifndef BEAST_UNIT_TEST_SUITE_LIST_HPP
9 #define BEAST_UNIT_TEST_SUITE_LIST_HPP
11 #include <beast/unit_test/suite_info.hpp>
12 #include <beast/unit_test/detail/const_container.hpp>
13 #include <boost/assert.hpp>
16 #include <unordered_set>
21 /// A container of test suites.
23 : public detail::const_container <std::set <suite_info>>
27 std::unordered_set<std::string> names_;
28 std::unordered_set<std::type_index> classes_;
32 /** Insert a suite into the set.
34 The suite must not already exist.
45 //------------------------------------------------------------------------------
58 s = std::string(library) + "." + module + "." + name;
59 auto const result(names_.insert(s));
60 BOOST_ASSERT(result.second); // Duplicate name
64 auto const result(classes_.insert(
65 std::type_index(typeid(Suite))));
66 BOOST_ASSERT(result.second); // Duplicate type
69 cont().emplace(make_suite_info<Suite>(
70 name, module, library, manual));