diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b6578f8b..ecabdb3f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -84,6 +84,7 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/matchers/catch_matchers_templated.hpp ${SOURCES_DIR}/matchers/catch_matchers_vector.hpp ${SOURCES_DIR}/catch_message.hpp + ${SOURCES_DIR}/internal/catch_message_info.hpp ${SOURCES_DIR}/internal/catch_meta.hpp ${SOURCES_DIR}/internal/catch_option.hpp ${SOURCES_DIR}/internal/catch_output_redirect.hpp @@ -151,6 +152,7 @@ set(IMPL_SOURCES ${SOURCES_DIR}/matchers/catch_matchers_string.cpp ${SOURCES_DIR}/matchers/catch_matchers_templated.cpp ${SOURCES_DIR}/catch_message.cpp + ${SOURCES_DIR}/internal/catch_message_info.cpp ${SOURCES_DIR}/internal/catch_output_redirect.cpp ${SOURCES_DIR}/catch_registry_hub.cpp ${SOURCES_DIR}/internal/catch_combined_tu.cpp diff --git a/src/catch2/catch_all.hpp b/src/catch2/catch_all.hpp index c3f35500..e39204aa 100644 --- a/src/catch2/catch_all.hpp +++ b/src/catch2/catch_all.hpp @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/src/catch2/catch_message.cpp b/src/catch2/catch_message.cpp index 08207ee7..3d66a5f4 100644 --- a/src/catch2/catch_message.cpp +++ b/src/catch2/catch_message.cpp @@ -16,27 +16,6 @@ namespace Catch { - MessageInfo::MessageInfo( StringRef const& _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ) - : macroName( _macroName ), - lineInfo( _lineInfo ), - type( _type ), - sequence( ++globalCount ) - {} - - bool MessageInfo::operator==( MessageInfo const& other ) const { - return sequence == other.sequence; - } - - bool MessageInfo::operator<( MessageInfo const& other ) const { - return sequence < other.sequence; - } - - // This may need protecting if threading support is added - unsigned int MessageInfo::globalCount = 0; - - //////////////////////////////////////////////////////////////////////////// Catch::MessageBuilder::MessageBuilder( StringRef const& macroName, diff --git a/src/catch2/catch_message.hpp b/src/catch2/catch_message.hpp index 07c99bb0..26b314dd 100644 --- a/src/catch2/catch_message.hpp +++ b/src/catch2/catch_message.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -19,23 +20,6 @@ namespace Catch { - struct MessageInfo { - MessageInfo( StringRef const& _macroName, - SourceLineInfo const& _lineInfo, - ResultWas::OfType _type ); - - StringRef macroName; - std::string message; - SourceLineInfo lineInfo; - ResultWas::OfType type; - unsigned int sequence; - - bool operator == ( MessageInfo const& other ) const; - bool operator < ( MessageInfo const& other ) const; - private: - static unsigned int globalCount; - }; - struct MessageStream { template diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp index 7e538d38..f0e612e7 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp index df47ef5c..01469999 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/catch2/internal/catch_message_info.cpp b/src/catch2/internal/catch_message_info.cpp new file mode 100644 index 00000000..65d990ad --- /dev/null +++ b/src/catch2/internal/catch_message_info.cpp @@ -0,0 +1,26 @@ + +#include + +namespace Catch { + + MessageInfo::MessageInfo( StringRef const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ) + : macroName( _macroName ), + lineInfo( _lineInfo ), + type( _type ), + sequence( ++globalCount ) + {} + + bool MessageInfo::operator==( MessageInfo const& other ) const { + return sequence == other.sequence; + } + + bool MessageInfo::operator<( MessageInfo const& other ) const { + return sequence < other.sequence; + } + + // This may need protecting if threading support is added + unsigned int MessageInfo::globalCount = 0; + +} // end namespace Catch diff --git a/src/catch2/internal/catch_message_info.hpp b/src/catch2/internal/catch_message_info.hpp new file mode 100644 index 00000000..b1af4565 --- /dev/null +++ b/src/catch2/internal/catch_message_info.hpp @@ -0,0 +1,31 @@ +#ifndef CATCH_MESSAGE_INFO_HPP_INCLUDED +#define CATCH_MESSAGE_INFO_HPP_INCLUDED + +#include +#include +#include + +#include + +namespace Catch { + + struct MessageInfo { + MessageInfo( StringRef const& _macroName, + SourceLineInfo const& _lineInfo, + ResultWas::OfType _type ); + + StringRef macroName; + std::string message; + SourceLineInfo lineInfo; + ResultWas::OfType type; + unsigned int sequence; + + bool operator == ( MessageInfo const& other ) const; + bool operator < ( MessageInfo const& other ) const; + private: + static unsigned int globalCount; + }; + +} // end namespace Catch + +#endif // CATCH_MESSAGE_INFO_HPP_INCLUDED diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp index ea72dde0..bfbd8bcf 100644 --- a/src/catch2/internal/catch_run_context.hpp +++ b/src/catch2/internal/catch_run_context.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include