//
// Copyright (c) 2013-2017 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)
//

#ifndef BEAST_UNIT_TEST_GLOBAL_SUITES_HPP
#define BEAST_UNIT_TEST_GLOBAL_SUITES_HPP

#include <ripple/beast/unit_test/suite_list.h>

namespace beast {
namespace unit_test {

namespace detail {

/// Holds test suites registered during static initialization.
inline suite_list&
global_suites()
{
    static suite_list s;
    return s;
}

template <class Suite>
struct insert_suite
{
    insert_suite(
        char const* name,
        char const* module,
        char const* library,
        bool manual,
        int priority)
    {
        global_suites().insert<Suite>(name, module, library, manual, priority);
    }
};

}  // namespace detail

/// Holds test suites registered during static initialization.
inline suite_list const&
global_suites()
{
    return detail::global_suites();
}

}  // namespace unit_test
}  // namespace beast

#endif
