line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
// Copyright Catch2 Authors |
3
|
|
|
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. |
4
|
|
|
|
|
|
|
// (See accompanying file LICENSE_1_0.txt or copy at |
5
|
|
|
|
|
|
|
// https://www.boost.org/LICENSE_1_0.txt) |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
// SPDX-License-Identifier: BSL-1.0 |
8
|
|
|
|
|
|
|
#ifndef CATCH_REPORTER_REGISTRARS_HPP_INCLUDED |
9
|
|
|
|
|
|
|
#define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#include |
12
|
|
|
|
|
|
|
#include |
13
|
|
|
|
|
|
|
#include |
14
|
|
|
|
|
|
|
#include |
15
|
|
|
|
|
|
|
#include |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
namespace Catch { |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
struct IStreamingReporter; |
20
|
|
|
|
|
|
|
using IStreamingReporterPtr = Detail::unique_ptr; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
template |
23
|
4
|
0
|
|
|
|
|
class ReporterFactory : public IReporterFactory { |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
|
IStreamingReporterPtr create( ReporterConfig const& config ) const override { |
26
|
5
|
50
|
|
|
|
|
return Detail::make_unique( config ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
std::string getDescription() const override { |
30
|
0
|
|
|
|
|
|
return T::getDescription(); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
template |
36
|
|
|
|
|
|
|
class ReporterRegistrar { |
37
|
|
|
|
|
|
|
public: |
38
|
2
|
|
|
|
|
|
explicit ReporterRegistrar( std::string const& name ) { |
39
|
2
|
50
|
|
|
|
|
getMutableRegistryHub().registerReporter( name, Detail::make_unique>() ); |
|
|
50
|
|
|
|
|
|
40
|
2
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
template |
44
|
|
|
|
|
|
|
class ListenerRegistrar { |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
class ListenerFactory : public IReporterFactory { |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
IStreamingReporterPtr create( ReporterConfig const& config ) const override { |
49
|
|
|
|
|
|
|
return Detail::make_unique(config); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
std::string getDescription() const override { |
52
|
|
|
|
|
|
|
return std::string(); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
}; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
public: |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
ListenerRegistrar() { |
59
|
|
|
|
|
|
|
getMutableRegistryHub().registerListener( Detail::make_unique() ); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
}; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
#if !defined(CATCH_CONFIG_DISABLE) |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#define CATCH_REGISTER_REPORTER( name, reporterType ) \ |
67
|
|
|
|
|
|
|
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ |
68
|
|
|
|
|
|
|
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ |
69
|
|
|
|
|
|
|
namespace{ Catch::ReporterRegistrar catch_internal_RegistrarFor##reporterType( name ); } \ |
70
|
|
|
|
|
|
|
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
#define CATCH_REGISTER_LISTENER( listenerType ) \ |
73
|
|
|
|
|
|
|
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ |
74
|
|
|
|
|
|
|
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ |
75
|
|
|
|
|
|
|
namespace{ Catch::ListenerRegistrar catch_internal_RegistrarFor##listenerType; } \ |
76
|
|
|
|
|
|
|
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION |
77
|
|
|
|
|
|
|
#else // CATCH_CONFIG_DISABLE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
#define CATCH_REGISTER_REPORTER(name, reporterType) |
80
|
|
|
|
|
|
|
#define CATCH_REGISTER_LISTENER(listenerType) |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#endif // CATCH_CONFIG_DISABLE |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
#endif // CATCH_REPORTER_REGISTRARS_HPP_INCLUDED |