Move matcher implementation to their own subfolder

In the future we can expect many more matchers, so let's give them
a place to live.

Also moved matcher-related internal files to `internal` subfolder.
Ideally we should sort out all of our source code, but that will
have to come later.
This commit is contained in:
Martin Hořeňovský 2020-02-20 13:57:24 +01:00
parent 40e35d4318
commit c3013a6251
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
25 changed files with 47 additions and 50 deletions

View File

@ -39,7 +39,7 @@ set(INTERNAL_HEADERS
${SOURCES_DIR}/catch_assertioninfo.h ${SOURCES_DIR}/catch_assertioninfo.h
${SOURCES_DIR}/catch_assertionresult.h ${SOURCES_DIR}/catch_assertionresult.h
${SOURCES_DIR}/catch_capture.hpp ${SOURCES_DIR}/catch_capture.hpp
${SOURCES_DIR}/catch_capture_matchers.h ${SOURCES_DIR}/internal/catch_capture_matchers.h
${SOURCES_DIR}/catch_clara.h ${SOURCES_DIR}/catch_clara.h
${SOURCES_DIR}/catch_commandline.h ${SOURCES_DIR}/catch_commandline.h
${SOURCES_DIR}/catch_common.h ${SOURCES_DIR}/catch_common.h
@ -72,13 +72,13 @@ set(INTERNAL_HEADERS
${SOURCES_DIR}/catch_interfaces_testcase.h ${SOURCES_DIR}/catch_interfaces_testcase.h
${SOURCES_DIR}/catch_leak_detector.h ${SOURCES_DIR}/catch_leak_detector.h
${SOURCES_DIR}/catch_list.h ${SOURCES_DIR}/catch_list.h
${SOURCES_DIR}/catch_matchers.h ${SOURCES_DIR}/matchers/catch_matchers.h
${SOURCES_DIR}/catch_matchers_exception.hpp ${SOURCES_DIR}/matchers/catch_matchers_exception.hpp
${SOURCES_DIR}/catch_matchers_floating.h ${SOURCES_DIR}/matchers/catch_matchers_floating.h
${SOURCES_DIR}/catch_matchers_generic.hpp ${SOURCES_DIR}/matchers/catch_matchers_generic.hpp
${SOURCES_DIR}/catch_matchers_string.h ${SOURCES_DIR}/matchers/catch_matchers_string.h
${SOURCES_DIR}/catch_matchers_templates.hpp ${SOURCES_DIR}/matchers/catch_matchers_templates.hpp
${SOURCES_DIR}/catch_matchers_vector.h ${SOURCES_DIR}/matchers/catch_matchers_vector.h
${SOURCES_DIR}/catch_message.h ${SOURCES_DIR}/catch_message.h
${SOURCES_DIR}/catch_meta.hpp ${SOURCES_DIR}/catch_meta.hpp
${SOURCES_DIR}/catch_objc.hpp ${SOURCES_DIR}/catch_objc.hpp
@ -130,7 +130,7 @@ set(IMPL_SOURCES
${SOURCES_DIR}/catch_approx.cpp ${SOURCES_DIR}/catch_approx.cpp
${SOURCES_DIR}/catch_assertionhandler.cpp ${SOURCES_DIR}/catch_assertionhandler.cpp
${SOURCES_DIR}/catch_assertionresult.cpp ${SOURCES_DIR}/catch_assertionresult.cpp
${SOURCES_DIR}/catch_capture_matchers.cpp ${SOURCES_DIR}/internal/catch_capture_matchers.cpp
${SOURCES_DIR}/catch_commandline.cpp ${SOURCES_DIR}/catch_commandline.cpp
${SOURCES_DIR}/catch_common.cpp ${SOURCES_DIR}/catch_common.cpp
${SOURCES_DIR}/catch_config.cpp ${SOURCES_DIR}/catch_config.cpp
@ -155,12 +155,12 @@ set(IMPL_SOURCES
${SOURCES_DIR}/catch_interfaces_testcase.cpp ${SOURCES_DIR}/catch_interfaces_testcase.cpp
${SOURCES_DIR}/catch_list.cpp ${SOURCES_DIR}/catch_list.cpp
${SOURCES_DIR}/catch_leak_detector.cpp ${SOURCES_DIR}/catch_leak_detector.cpp
${SOURCES_DIR}/catch_matchers.cpp ${SOURCES_DIR}/matchers/catch_matchers.cpp
${SOURCES_DIR}/catch_matchers_exception.cpp ${SOURCES_DIR}/matchers/catch_matchers_exception.cpp
${SOURCES_DIR}/catch_matchers_floating.cpp ${SOURCES_DIR}/matchers/catch_matchers_floating.cpp
${SOURCES_DIR}/catch_matchers_generic.cpp ${SOURCES_DIR}/matchers/catch_matchers_generic.cpp
${SOURCES_DIR}/catch_matchers_string.cpp ${SOURCES_DIR}/matchers/catch_matchers_string.cpp
${SOURCES_DIR}/catch_matchers_templates.cpp ${SOURCES_DIR}/matchers/catch_matchers_templates.cpp
${SOURCES_DIR}/catch_message.cpp ${SOURCES_DIR}/catch_message.cpp
${SOURCES_DIR}/catch_output_redirect.cpp ${SOURCES_DIR}/catch_output_redirect.cpp
${SOURCES_DIR}/catch_registry_hub.cpp ${SOURCES_DIR}/catch_registry_hub.cpp

View File

@ -14,9 +14,9 @@
#include <catch2/catch_enforce.h> #include <catch2/catch_enforce.h>
#include <catch2/catch_debugger.h> #include <catch2/catch_debugger.h>
#include <catch2/catch_interfaces_registry_hub.h> #include <catch2/catch_interfaces_registry_hub.h>
#include <catch2/catch_capture_matchers.h> #include <catch2/internal/catch_capture_matchers.h>
#include <catch2/catch_run_context.h> #include <catch2/catch_run_context.h>
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
namespace Catch { namespace Catch {

View File

@ -2,8 +2,8 @@
* Distributed under the Boost Software License, Version 1.0. (See accompanying * 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) * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/ */
#include <catch2/catch_capture_matchers.h> #include <catch2/internal/catch_capture_matchers.h>
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
#include <catch2/catch_interfaces_registry_hub.h> #include <catch2/catch_interfaces_registry_hub.h>
namespace Catch { namespace Catch {

View File

@ -3,7 +3,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/ */
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
namespace Catch { namespace Catch {

View File

@ -6,7 +6,7 @@
#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
#include <catch2/catch_common.h> #include <catch2/catch_common.h>
#include <catch2/catch_capture_matchers.h> #include <catch2/internal/catch_capture_matchers.h>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -5,7 +5,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/ */
#include <catch2/catch_matchers_exception.hpp> #include <catch2/matchers/catch_matchers_exception.hpp>
namespace Catch { namespace Catch {

View File

@ -7,7 +7,7 @@
#ifndef TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED #ifndef TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
namespace Catch { namespace Catch {
namespace Matchers { namespace Matchers {

View File

@ -5,7 +5,7 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/ */
#include <catch2/catch_matchers_floating.h> #include <catch2/matchers/catch_matchers_floating.h>
#include <catch2/catch_enforce.h> #include <catch2/catch_enforce.h>
#include <catch2/catch_polyfills.hpp> #include <catch2/catch_polyfills.hpp>
#include <catch2/catch_to_string.hpp> #include <catch2/catch_to_string.hpp>

View File

@ -7,7 +7,7 @@
#ifndef TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED #ifndef TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
#define TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
namespace Catch { namespace Catch {
namespace Matchers { namespace Matchers {

View File

@ -1,4 +1,4 @@
#include <catch2/catch_matchers_generic.hpp> #include <catch2/matchers/catch_matchers_generic.hpp>
std::string Catch::Matchers::Generic::Detail::finalizeDescription(const std::string& desc) { std::string Catch::Matchers::Generic::Detail::finalizeDescription(const std::string& desc) {
if (desc.empty()) { if (desc.empty()) {

View File

@ -8,7 +8,7 @@
#define TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED
#include <catch2/catch_common.h> #include <catch2/catch_common.h>
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
#include <catch2/catch_meta.hpp> #include <catch2/catch_meta.hpp>
#include <string> #include <string>

View File

@ -1,12 +1,9 @@
/* /*
* Created by Phil Nash on 08/02/2017.
* Copyright (c) 2017 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying * 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) * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/ */
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
#include <catch2/catch_string_manip.h> #include <catch2/catch_string_manip.h>
#include <catch2/catch_tostring.h> #include <catch2/catch_tostring.h>

View File

@ -8,7 +8,7 @@
#ifndef TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED #ifndef TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
#define TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
#include <string> #include <string>

View File

@ -1,4 +1,4 @@
#include <catch2/catch_matchers_templates.hpp> #include <catch2/matchers/catch_matchers_templates.hpp>
namespace Catch { namespace Catch {
namespace Matchers { namespace Matchers {

View File

@ -2,7 +2,7 @@
#define TWOBLUECUBES_CATCH_MATCHERS_TEMPLATES_HPP_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_TEMPLATES_HPP_INCLUDED
#include <catch2/catch_common.h> #include <catch2/catch_common.h>
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
#include <catch2/catch_stringref.h> #include <catch2/catch_stringref.h>
#include <array> #include <array>

View File

@ -8,7 +8,7 @@
#ifndef TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED #ifndef TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
#define TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED
#include <catch2/catch_matchers.h> #include <catch2/matchers/catch_matchers.h>
#include <catch2/catch_approx.h> #include <catch2/catch_approx.h>
#include <algorithm> #include <algorithm>

View File

@ -5,8 +5,8 @@
// This won't provide full coverage, but it might be worth checking // This won't provide full coverage, but it might be worth checking
// the other branch as well // the other branch as well
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/catch_matchers_generic.hpp> #include <catch2/matchers/catch_matchers_generic.hpp>
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
#include <type_traits> #include <type_traits>
#include <stdexcept> #include <stdexcept>

View File

@ -5,7 +5,7 @@
#include <catch2/catch_approx.h> #include <catch2/catch_approx.h>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
#include <catch2/catch_test_spec_parser.h> #include <catch2/catch_test_spec_parser.h>
#include <catch2/catch_test_case_info.h> #include <catch2/catch_test_case_info.h>
#include <catch2/catch_config.hpp> #include <catch2/catch_config.hpp>

View File

@ -1,5 +1,5 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/catch_matchers_vector.h> #include <catch2/matchers/catch_matchers_vector.h>
#include <catch2/catch_string_manip.h> #include <catch2/catch_string_manip.h>
static const char * const no_whitespace = "There is no extra whitespace here"; static const char * const no_whitespace = "There is no extra whitespace here";

View File

@ -3,8 +3,8 @@
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/ */
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
#include <catch2/catch_matchers_vector.h> #include <catch2/matchers/catch_matchers_vector.h>
#include <catch2/catch_tag_alias_registry.h> #include <catch2/catch_tag_alias_registry.h>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/catch_test_case_info.h> #include <catch2/catch_test_case_info.h>

View File

@ -1,5 +1,5 @@
#include <catch2/catch_enum_values_registry.h> #include <catch2/catch_enum_values_registry.h>
#include <catch2/catch_matchers_vector.h> #include <catch2/matchers/catch_matchers_vector.h>
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
enum class EnumClass3 { Value1, Value2, Value3, Value4 }; enum class EnumClass3 { Value1, Value2, Value3, Value4 };

View File

@ -29,7 +29,7 @@ std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) {
/////////////////////////////// ///////////////////////////////
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
#include <cstring> #include <cstring>

View File

@ -4,7 +4,7 @@
*/ */
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
#include <string> #include <string>
#include <stdexcept> #include <stdexcept>

View File

@ -4,12 +4,12 @@
*/ */
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/catch_matchers_exception.hpp> #include <catch2/matchers/catch_matchers_exception.hpp>
#include <catch2/catch_matchers_floating.h> #include <catch2/matchers/catch_matchers_floating.h>
#include <catch2/catch_matchers_generic.hpp> #include <catch2/matchers/catch_matchers_generic.hpp>
#include <catch2/catch_matchers_string.h> #include <catch2/matchers/catch_matchers_string.h>
#include <catch2/catch_matchers_vector.h> #include <catch2/matchers/catch_matchers_vector.h>
#include <catch2/catch_matchers_templates.hpp> #include <catch2/matchers/catch_matchers_templates.hpp>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>