From c2daf468bb17d4e269183e895f14c6f9ff50b09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sun, 1 Mar 2020 19:59:18 +0100 Subject: [PATCH] Standardize matcher headers to use .hpp suffix --- docs/matchers.md | 14 +++++++------- src/CMakeLists.txt | 8 ++++---- src/catch2/catch_assertionhandler.cpp | 2 +- src/catch2/internal/catch_capture_matchers.cpp | 2 +- src/catch2/matchers/catch_matchers.cpp | 2 +- .../{catch_matchers.h => catch_matchers.hpp} | 0 src/catch2/matchers/catch_matchers_exception.hpp | 2 +- src/catch2/matchers/catch_matchers_floating.cpp | 2 +- ...hers_floating.h => catch_matchers_floating.hpp} | 2 +- src/catch2/matchers/catch_matchers_generic.hpp | 2 +- src/catch2/matchers/catch_matchers_string.cpp | 2 +- ...matchers_string.h => catch_matchers_string.hpp} | 2 +- src/catch2/matchers/catch_matchers_templates.hpp | 2 +- ...matchers_vector.h => catch_matchers_vector.hpp} | 2 +- tests/ExtraTests/X01-PrefixedMacros.cpp | 2 +- .../SelfTest/IntrospectiveTests/CmdLine.tests.cpp | 2 +- .../IntrospectiveTests/StringManip.tests.cpp | 2 +- tests/SelfTest/IntrospectiveTests/Tag.tests.cpp | 4 ++-- .../SelfTest/IntrospectiveTests/ToString.tests.cpp | 2 +- tests/SelfTest/UsageTests/Compilation.tests.cpp | 2 +- tests/SelfTest/UsageTests/Exception.tests.cpp | 2 +- tests/SelfTest/UsageTests/Matchers.tests.cpp | 6 +++--- 22 files changed, 33 insertions(+), 33 deletions(-) rename src/catch2/matchers/{catch_matchers.h => catch_matchers.hpp} (100%) rename src/catch2/matchers/{catch_matchers_floating.h => catch_matchers_floating.hpp} (98%) rename src/catch2/matchers/{catch_matchers_string.h => catch_matchers_string.hpp} (98%) rename src/catch2/matchers/{catch_matchers_vector.h => catch_matchers_vector.hpp} (99%) diff --git a/docs/matchers.md b/docs/matchers.md index 26da2679..dbeb1cfc 100644 --- a/docs/matchers.md +++ b/docs/matchers.md @@ -47,8 +47,8 @@ _both_ ends with the suffix "as a service" _and_ contains the string Both of the string matchers used in the examples above live in the -`catch_matchers_string.h` header, so to compile the code above also -requires `#include `. +`catch_matchers_string.hpp` header, so to compile the code above also +requires `#include `. **IMPORTANT**: The combining operators do not take ownership of the matcher objects being combined. This means that if you store combined @@ -108,7 +108,7 @@ the regex `"abc"` will not match input string `"abcd"`. To match The second argument sets whether the matching should be case-sensitive or not. By default, it is case-sensitive. -> `std::string` matchers live in `catch2/matchers/catch_matchers_string.h` +> `std::string` matchers live in `catch2/matchers/catch_matchers_string.hpp` ### Vector matchers @@ -136,7 +136,7 @@ An example usage: This assertions will pass, because the elements given to the matchers are a permutation of the ones in `some_vec`. -> vector matchers live in `catch2/matchers/catch_matchers_vector.h` +> vector matchers live in `catch2/matchers/catch_matchers_vector.hpp` ### Floating point matchers @@ -187,7 +187,7 @@ to zero, we would write this assertion: ``` -> floating point matchers live in `catch2/matchers/catch_matchers_floating.h` +> floating point matchers live in `catch2/matchers/catch_matchers_floating.hpp` ### Miscellaneous matchers @@ -223,7 +223,7 @@ Catch2 provides an utility macro for asserting that an expression throws exception of specific type, and that the exception has desired properties. The macro is `REQUIRE_THROWS_MATCHES(expr, ExceptionType, Matcher)`. -> `REQUIRE_THROWS_MATCHES` macro lives in `catch2/matchers/catch_matchers.h` +> `REQUIRE_THROWS_MATCHES` macro lives in `catch2/matchers/catch_matchers.hpp` Catch2 currently provides only one matcher for exceptions, @@ -311,7 +311,7 @@ written using the new style, combining old style matchers should generally compile faster. Also note that you can combine old and new style matchers arbitrarily. -> `MatcherBase` lives in `catch2/matchers/catch_matchers.h` +> `MatcherBase` lives in `catch2/matchers/catch_matchers.hpp` ## Writing custom matchers (new style) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 43f9c63d..d2c41fa4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,13 +72,13 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/catch_interfaces_testcase.h ${SOURCES_DIR}/catch_leak_detector.h ${SOURCES_DIR}/catch_list.h - ${SOURCES_DIR}/matchers/catch_matchers.h + ${SOURCES_DIR}/matchers/catch_matchers.hpp ${SOURCES_DIR}/matchers/catch_matchers_exception.hpp - ${SOURCES_DIR}/matchers/catch_matchers_floating.h + ${SOURCES_DIR}/matchers/catch_matchers_floating.hpp ${SOURCES_DIR}/matchers/catch_matchers_generic.hpp - ${SOURCES_DIR}/matchers/catch_matchers_string.h + ${SOURCES_DIR}/matchers/catch_matchers_string.hpp ${SOURCES_DIR}/matchers/catch_matchers_templates.hpp - ${SOURCES_DIR}/matchers/catch_matchers_vector.h + ${SOURCES_DIR}/matchers/catch_matchers_vector.hpp ${SOURCES_DIR}/catch_message.h ${SOURCES_DIR}/catch_meta.hpp ${SOURCES_DIR}/catch_objc.hpp diff --git a/src/catch2/catch_assertionhandler.cpp b/src/catch2/catch_assertionhandler.cpp index cf102ae7..9d321a52 100644 --- a/src/catch2/catch_assertionhandler.cpp +++ b/src/catch2/catch_assertionhandler.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include namespace Catch { diff --git a/src/catch2/internal/catch_capture_matchers.cpp b/src/catch2/internal/catch_capture_matchers.cpp index c13d0543..750a0e91 100644 --- a/src/catch2/internal/catch_capture_matchers.cpp +++ b/src/catch2/internal/catch_capture_matchers.cpp @@ -3,7 +3,7 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include -#include +#include #include namespace Catch { diff --git a/src/catch2/matchers/catch_matchers.cpp b/src/catch2/matchers/catch_matchers.cpp index a8737497..20d1ef92 100644 --- a/src/catch2/matchers/catch_matchers.cpp +++ b/src/catch2/matchers/catch_matchers.cpp @@ -3,7 +3,7 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#include +#include namespace Catch { diff --git a/src/catch2/matchers/catch_matchers.h b/src/catch2/matchers/catch_matchers.hpp similarity index 100% rename from src/catch2/matchers/catch_matchers.h rename to src/catch2/matchers/catch_matchers.hpp diff --git a/src/catch2/matchers/catch_matchers_exception.hpp b/src/catch2/matchers/catch_matchers_exception.hpp index fabc26ea..03389005 100644 --- a/src/catch2/matchers/catch_matchers_exception.hpp +++ b/src/catch2/matchers/catch_matchers_exception.hpp @@ -7,7 +7,7 @@ #ifndef TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED -#include +#include namespace Catch { namespace Matchers { diff --git a/src/catch2/matchers/catch_matchers_floating.cpp b/src/catch2/matchers/catch_matchers_floating.cpp index 77684458..071c10a3 100644 --- a/src/catch2/matchers/catch_matchers_floating.cpp +++ b/src/catch2/matchers/catch_matchers_floating.cpp @@ -5,7 +5,7 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#include +#include #include #include #include diff --git a/src/catch2/matchers/catch_matchers_floating.h b/src/catch2/matchers/catch_matchers_floating.hpp similarity index 98% rename from src/catch2/matchers/catch_matchers_floating.h rename to src/catch2/matchers/catch_matchers_floating.hpp index a935b570..cb49cf26 100644 --- a/src/catch2/matchers/catch_matchers_floating.h +++ b/src/catch2/matchers/catch_matchers_floating.hpp @@ -7,7 +7,7 @@ #ifndef TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_FLOATING_H_INCLUDED -#include +#include namespace Catch { namespace Matchers { diff --git a/src/catch2/matchers/catch_matchers_generic.hpp b/src/catch2/matchers/catch_matchers_generic.hpp index 90f26d0c..81e21c42 100644 --- a/src/catch2/matchers/catch_matchers_generic.hpp +++ b/src/catch2/matchers/catch_matchers_generic.hpp @@ -8,7 +8,7 @@ #define TWOBLUECUBES_CATCH_MATCHERS_GENERIC_HPP_INCLUDED #include -#include +#include #include #include diff --git a/src/catch2/matchers/catch_matchers_string.cpp b/src/catch2/matchers/catch_matchers_string.cpp index 91282ddf..d4521809 100644 --- a/src/catch2/matchers/catch_matchers_string.cpp +++ b/src/catch2/matchers/catch_matchers_string.cpp @@ -3,7 +3,7 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#include +#include #include #include diff --git a/src/catch2/matchers/catch_matchers_string.h b/src/catch2/matchers/catch_matchers_string.hpp similarity index 98% rename from src/catch2/matchers/catch_matchers_string.h rename to src/catch2/matchers/catch_matchers_string.hpp index c1096b14..6e351cd0 100644 --- a/src/catch2/matchers/catch_matchers_string.h +++ b/src/catch2/matchers/catch_matchers_string.hpp @@ -8,7 +8,7 @@ #ifndef TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_STRING_H_INCLUDED -#include +#include #include diff --git a/src/catch2/matchers/catch_matchers_templates.hpp b/src/catch2/matchers/catch_matchers_templates.hpp index 43ae5dfc..34e067ff 100644 --- a/src/catch2/matchers/catch_matchers_templates.hpp +++ b/src/catch2/matchers/catch_matchers_templates.hpp @@ -2,7 +2,7 @@ #define TWOBLUECUBES_CATCH_MATCHERS_TEMPLATES_HPP_INCLUDED #include -#include +#include #include #include diff --git a/src/catch2/matchers/catch_matchers_vector.h b/src/catch2/matchers/catch_matchers_vector.hpp similarity index 99% rename from src/catch2/matchers/catch_matchers_vector.h rename to src/catch2/matchers/catch_matchers_vector.hpp index 620b7211..24300641 100644 --- a/src/catch2/matchers/catch_matchers_vector.h +++ b/src/catch2/matchers/catch_matchers_vector.hpp @@ -8,7 +8,7 @@ #ifndef TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_VECTOR_H_INCLUDED -#include +#include #include #include diff --git a/tests/ExtraTests/X01-PrefixedMacros.cpp b/tests/ExtraTests/X01-PrefixedMacros.cpp index 89f128b7..82ca2ed3 100644 --- a/tests/ExtraTests/X01-PrefixedMacros.cpp +++ b/tests/ExtraTests/X01-PrefixedMacros.cpp @@ -6,7 +6,7 @@ // the other branch as well #include #include -#include +#include #include #include diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp index cea898da..f8d6bd3b 100644 --- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp b/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp index 19a1e0f2..327c8811 100644 --- a/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include static const char * const no_whitespace = "There is no extra whitespace here"; diff --git a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp index 3621fcd7..7765c2fa 100644 --- a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp @@ -3,8 +3,8 @@ * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#include -#include +#include +#include #include #include #include diff --git a/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp b/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp index 98cc9024..d82b5402 100644 --- a/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include enum class EnumClass3 { Value1, Value2, Value3, Value4 }; diff --git a/tests/SelfTest/UsageTests/Compilation.tests.cpp b/tests/SelfTest/UsageTests/Compilation.tests.cpp index 5750ad72..1c43c1c3 100644 --- a/tests/SelfTest/UsageTests/Compilation.tests.cpp +++ b/tests/SelfTest/UsageTests/Compilation.tests.cpp @@ -29,7 +29,7 @@ std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) { /////////////////////////////// #include -#include +#include #include diff --git a/tests/SelfTest/UsageTests/Exception.tests.cpp b/tests/SelfTest/UsageTests/Exception.tests.cpp index d58b1933..8fb3e2f0 100644 --- a/tests/SelfTest/UsageTests/Exception.tests.cpp +++ b/tests/SelfTest/UsageTests/Exception.tests.cpp @@ -4,7 +4,7 @@ */ #include -#include +#include #include #include diff --git a/tests/SelfTest/UsageTests/Matchers.tests.cpp b/tests/SelfTest/UsageTests/Matchers.tests.cpp index 06db9a1a..67b55d06 100644 --- a/tests/SelfTest/UsageTests/Matchers.tests.cpp +++ b/tests/SelfTest/UsageTests/Matchers.tests.cpp @@ -5,10 +5,10 @@ #include #include -#include +#include #include -#include -#include +#include +#include #include #include