diff options
| author | Martin Hořeňovský | 2021-12-18 20:48:43 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-12-18 20:50:05 +0100 |
| commit | 3cc0c033e4c359dfea006b749416a0cd3a322c1c (patch) | |
| tree | 34181026aef41ade6f4662893bc2268a928b7bd6 /src/catch2/internal | |
| parent | 840acedf62b2dabb98bf4ab372a7582131d6b530 (diff) | |
| download | catch3-3cc0c033e4c359dfea006b749416a0cd3a322c1c.tar.gz | |
Allow enabling multiple warnings in one invocation
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_commandline.cpp | 6 |
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" ) |