| 1 | |
| 2 | // Copyright Catch2 Authors |
| 3 | // Distributed under the Boost Software License, Version 1.0. |
| 4 | // (See accompanying file LICENSE.txt or copy at |
| 5 | // https://www.boost.org/LICENSE_1_0.txt) |
| 6 | |
| 7 | // SPDX-License-Identifier: BSL-1.0 |
| 8 | |
| 9 | /**\file |
| 10 | * Checks that reporter registration errors are caught and handled as |
| 11 | * startup errors, by causing a registration error by registering multiple |
| 12 | * reporters with the same name. |
| 13 | */ |
| 14 | |
| 15 | #include <catch2/catch_test_macros.hpp> |
| 16 | |
| 17 | #include <catch2/reporters/catch_reporter_registrars.hpp> |
| 18 | #include <catch2/reporters/catch_reporter_streaming_base.hpp> |
| 19 | |
| 20 | namespace { |
| 21 | //! Trivial custom reporter for registration |
| 22 | class TestReporter : public Catch::StreamingReporterBase { |
| 23 | public: |
| 24 | using StreamingReporterBase::StreamingReporterBase; |
| 25 | |
| 26 | static std::string getDescription() { return "X35 test reporter"; } |
| 27 | }; |
| 28 | } |
| 29 | |
| 30 | CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) |
| 31 | CATCH_REGISTER_REPORTER( "test-reporter", TestReporter ) |