Clara cleanups

* Clara is now split between a header and a cpp file.
* Removed the deprecated `+` and `+=` operators for composing
  a parser.
* Renamed `clara` and `detail` namespaces to be inline with the
rest of Catch2 (they are now `Clara` and `Detail` respectively).
* Taken most of user-exposed types out of the `Detail` namespace
completely (instead of using `using` directives to bring them into
the outer namespace).
This commit is contained in:
Martin Hořeňovský 2020-08-08 18:18:27 +02:00
parent b824d06844
commit 24b83edf8a
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
9 changed files with 1082 additions and 969 deletions

View file

@ -19,9 +19,9 @@
namespace Catch {
clara::Parser makeCommandLineParser( ConfigData& config ) {
Clara::Parser makeCommandLineParser( ConfigData& config ) {
using namespace clara;
using namespace Clara;
auto const setWarning = [&]( std::string const& warning ) {
auto warningSet = [&]() {
@ -68,12 +68,12 @@ namespace Catch {
else if( startsWith( "random", order ) )
config.runOrder = RunTests::InRandomOrder;
else
return clara::ParserResult::runtimeError( "Unrecognised ordering: '" + order + "'" );
return ParserResult::runtimeError( "Unrecognised ordering: '" + order + "'" );
return ParserResult::ok( ParseResultType::Matched );
};
auto const setRngSeed = [&]( std::string const& seed ) {
if( seed != "time" )
return clara::detail::convertInto( seed, config.rngSeed );
return Clara::Detail::convertInto( seed, config.rngSeed );
config.rngSeed = static_cast<unsigned int>( std::time(nullptr) );
return ParserResult::ok( ParseResultType::Matched );
};