Moved matcher-based capture macros into their own file
- this file excluded from the CATCH_CONFIG_DISABLE_MATCHERS path. - matchers are always compiled in to the impl file - _THROWS_WITH macros are still available with matchers disabled - but only the ones that take a string - tests that use matchers have #ifdefs, so the whole SelfTest project can compile with matchers disable.
This commit is contained in:
parent
b59e0ed48a
commit
ee9b19efd3
18 changed files with 143 additions and 105 deletions
23
include/internal/catch_capture_matchers.cpp
Normal file
23
include/internal/catch_capture_matchers.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Created by Phil on 9/8/2017.
|
||||
* Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include "catch_capture_matchers.h"
|
||||
#include "catch_interfaces_registry_hub.h"
|
||||
|
||||
namespace Catch {
|
||||
|
||||
using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
|
||||
|
||||
// This is the general overload that takes a any string matcher
|
||||
// There is another overload, in catch_assertinhandler.h/.cpp, that only takes a string and infers
|
||||
// the Equals matcher (so the header does not mention matchers)
|
||||
void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) {
|
||||
MatchExpr<std::string, StringMatcher const&> expr( Catch::translateActiveException(), matcher, matcherString );
|
||||
handler.handle( expr );
|
||||
}
|
||||
|
||||
} // namespace Catch
|
Loading…
Add table
Add a link
Reference in a new issue