Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-12-18 20:48:43 +0100
committerMartin Hořeňovský2021-12-18 20:50:05 +0100
commit3cc0c033e4c359dfea006b749416a0cd3a322c1c (patch)
tree34181026aef41ade6f4662893bc2268a928b7bd6 /src
parent840acedf62b2dabb98bf4ab372a7582131d6b530 (diff)
downloadcatch3-3cc0c033e4c359dfea006b749416a0cd3a322c1c.tar.gz
Allow enabling multiple warnings in one invocation
Diffstat (limited to 'src')
-rw-r--r--src/catch2/internal/catch_commandline.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_commandline.cpp b/src/catch2/internal/catch_commandline.cpp
index 71550945..de27e899 100644
--- a/src/catch2/internal/catch_commandline.cpp
+++ b/src/catch2/internal/catch_commandline.cpp
@@ -25,10 +25,10 @@ namespace Catch {
auto const setWarning = [&]( std::string const& warning ) {
if ( warning == "NoAssertions" ) {
- config.warnings = WarnAbout::NoAssertions;
+ config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::NoAssertions);
return ParserResult::ok( ParseResultType::Matched );
} else if ( warning == "UnmatchedTestSpec" ) {
- config.warnings = WarnAbout::UnmatchedTestSpec;
+ config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::UnmatchedTestSpec);
return ParserResult::ok( ParseResultType::Matched );
}
@@ -217,7 +217,7 @@ namespace Catch {
| Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" )
["-x"]["--abortx"]
( "abort after x failures" )
- | Opt( setWarning, "warning name" )
+ | Opt( accept_many, setWarning, "warning name" )
["-w"]["--warn"]
( "enable warnings" )
| Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )