@@ -93,13 +93,26 @@ namespace Catch {
9393 return {};
9494 }
9595 }
96+
97+ Optional<Verbosity> stringToVerbosity ( StringRef verbosity ) {
98+ if (verbosity == " quiet" ) { return Verbosity::Quiet;
99+ } else if ( verbosity == " normal" ) {
100+ return Verbosity::Normal;
101+ } else if ( verbosity == " high" ) {
102+ return Verbosity::High;
103+ } else {
104+ return {};
105+ }
106+ }
107+
96108 } // namespace Detail
97109
98110
99111 bool operator ==( ReporterSpec const & lhs, ReporterSpec const & rhs ) {
100112 return lhs.m_name == rhs.m_name &&
101113 lhs.m_outputFileName == rhs.m_outputFileName &&
102114 lhs.m_colourMode == rhs.m_colourMode &&
115+ lhs.m_verbosity == rhs.m_verbosity &&
103116 lhs.m_customOptions == rhs.m_customOptions ;
104117 }
105118
@@ -111,6 +124,7 @@ namespace Catch {
111124 std::map<std::string, std::string> kvPairs;
112125 Optional<std::string> outputFileName;
113126 Optional<ColourMode> colourMode;
127+ Optional<Verbosity> verbosity;
114128
115129 // First part is always reporter name, so we skip it
116130 for ( size_t i = 1 ; i < parts.size (); ++i ) {
@@ -148,6 +162,12 @@ namespace Catch {
148162 if ( !colourMode ) {
149163 return {};
150164 }
165+ } else if ( key == " verbosity" ) {
166+ // Duplicated key
167+ if ( verbosity ) { return {}; }
168+ verbosity = Detail::stringToVerbosity ( value );
169+ // Parsing failed
170+ if ( !verbosity ) { return {}; }
151171 } else {
152172 // Unrecognized option
153173 return {};
@@ -157,17 +177,20 @@ namespace Catch {
157177 return ReporterSpec{ CATCH_MOVE ( parts[0 ] ),
158178 CATCH_MOVE ( outputFileName ),
159179 CATCH_MOVE ( colourMode ),
180+ CATCH_MOVE ( verbosity),
160181 CATCH_MOVE ( kvPairs ) };
161182 }
162183
163184ReporterSpec::ReporterSpec (
164185 std::string name,
165186 Optional<std::string> outputFileName,
166187 Optional<ColourMode> colourMode,
188+ Optional<Verbosity> verbosity,
167189 std::map<std::string, std::string> customOptions ):
168190 m_name ( CATCH_MOVE ( name ) ),
169191 m_outputFileName ( CATCH_MOVE ( outputFileName ) ),
170192 m_colourMode ( CATCH_MOVE ( colourMode ) ),
193+ m_verbosity ( CATCH_MOVE ( verbosity ) ),
171194 m_customOptions ( CATCH_MOVE ( customOptions ) ) {}
172195
173196} // namespace Catch
0 commit comments