mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Started work on splitting out .cpp files from header files
This commit is contained in:
		| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_assertionresult.h" | ||||
| 
 | ||||
| @@ -54,12 +52,6 @@ namespace Catch { | ||||
|         return !m_resultData.message.empty(); | ||||
|     } | ||||
| 
 | ||||
|     std::string capturedExpressionWithSecondArgument( char const * capturedExpression, char const * secondArg ) { | ||||
|         return (secondArg[0] == 0 || secondArg[0] == '"' && secondArg[1] == '"') | ||||
|             ? capturedExpression | ||||
|             : std::string(capturedExpression) + ", " + secondArg; | ||||
|     } | ||||
| 
 | ||||
|     std::string AssertionResult::getExpression() const { | ||||
|         if (isFalseTest(m_info.resultDisposition)) | ||||
|             return '!' + std::string(m_info.capturedExpression); | ||||
| @@ -102,5 +94,3 @@ namespace Catch { | ||||
|     } | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED
 | ||||
| @@ -10,6 +10,7 @@ | ||||
|  | ||||
| #include <string> | ||||
| #include "catch_result_type.h" | ||||
| #include "catch_common.h" | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|   | ||||
| @@ -5,10 +5,10 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_common.h" | ||||
| #include "catch_context.h" | ||||
| #include "catch_interfaces_config.h" | ||||
| 
 | ||||
| #include <cstring> | ||||
| #include <cctype> | ||||
| @@ -107,6 +107,3 @@ namespace Catch { | ||||
|         return os; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED
 | ||||
| 
 | ||||
| @@ -5,11 +5,13 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_console_colour.hpp" | ||||
| #include "catch_errno_guard.hpp" | ||||
| #include "catch_errno_guard.h" | ||||
| #include "catch_interfaces_config.h" | ||||
| #include "catch_stream.h" | ||||
| #include "catch_context.h" | ||||
| #include "catch_platform.h" | ||||
| 
 | ||||
| namespace Catch { | ||||
|     namespace { | ||||
| @@ -186,5 +188,3 @@ namespace Catch { | ||||
|     } | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED
 | ||||
| @@ -8,10 +8,8 @@ | ||||
| #ifndef TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_run_context.hpp" | ||||
| 
 | ||||
| #include "catch_stream.h" | ||||
| #include "catch_context.h" | ||||
| #include "catch_stream.hpp" | ||||
| #include "catch_common.h" | ||||
| 
 | ||||
| namespace Catch { | ||||
| @@ -6,11 +6,10 @@ | ||||
|  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 | ||||
|  * | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_debugger.h" | ||||
| #include "catch_errno_guard.hpp" | ||||
| #include "catch_errno_guard.h" | ||||
| #include "catch_stream.h" | ||||
| 
 | ||||
| #ifdef CATCH_PLATFORM_MAC | ||||
| 
 | ||||
| @@ -127,5 +126,3 @@ | ||||
|         } | ||||
|     } | ||||
| #endif // Platform
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED
 | ||||
							
								
								
									
										15
									
								
								include/internal/catch_errno_guard.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								include/internal/catch_errno_guard.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| /* | ||||
|  *  Created by Martin on 06/03/2017. | ||||
|  * | ||||
|  *  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_errno_guard.h" | ||||
|  | ||||
| #include <cerrno> | ||||
|  | ||||
| namespace Catch { | ||||
|         ErrnoGuard::ErrnoGuard():m_oldErrno(errno){} | ||||
|         ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; } | ||||
| } | ||||
| @@ -4,22 +4,19 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_ERRNO_GUARD_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_ERRNO_GUARD_HPP_INCLUDED | ||||
| 
 | ||||
| #include <cerrno> | ||||
| 
 | ||||
| #ifndef TWOBLUECUBES_CATCH_ERRNO_GUARD_H_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_ERRNO_GUARD_H_INCLUDED | ||||
| 
 | ||||
| namespace Catch { | ||||
| 
 | ||||
|     class ErrnoGuard { | ||||
|     public: | ||||
|         ErrnoGuard():m_oldErrno(errno){} | ||||
|         ~ErrnoGuard() { errno = m_oldErrno; } | ||||
|         ErrnoGuard(); | ||||
|         ~ErrnoGuard(); | ||||
|     private: | ||||
|         int m_oldErrno; | ||||
|     }; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_ERRNO_GUARD_HPP_INCLUDED
 | ||||
| #endif // TWOBLUECUBES_CATCH_ERRNO_GUARD_H_INCLUDED
 | ||||
| @@ -10,6 +10,7 @@ | ||||
|  | ||||
| #include "catch_interfaces_exception.h" | ||||
| #include "catch_tostring.h" | ||||
| #include "catch_result_builder.h" | ||||
|  | ||||
| #ifdef __OBJC__ | ||||
| #import "Foundation/Foundation.h" | ||||
|   | ||||
							
								
								
									
										181
									
								
								include/internal/catch_fatal_condition.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										181
									
								
								include/internal/catch_fatal_condition.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,181 @@ | ||||
| /* | ||||
|  *  Created by Phil on 21/08/2014 | ||||
|  *  Copyright 2014 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_fatal_condition.h" | ||||
|  | ||||
| #include "catch_context.h" | ||||
| #include "catch_interfaces_capture.h" | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     // Report the error condition | ||||
|     void reportFatal( std::string const& message ) { | ||||
|         IContext& context = Catch::getCurrentContext(); | ||||
|         IResultCapture* resultCapture = context.getResultCapture(); | ||||
|         resultCapture->handleFatalErrorCondition( message ); | ||||
|     } | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// | ||||
|  | ||||
| #  if !defined ( CATCH_CONFIG_WINDOWS_SEH ) | ||||
|  | ||||
| namespace Catch { | ||||
|     void FatalConditionHandler::reset() {} | ||||
| } | ||||
|  | ||||
| #  else // CATCH_CONFIG_WINDOWS_SEH is defined | ||||
|  | ||||
| namespace Catch { | ||||
|     struct SignalDefs { DWORD id; const char* name; }; | ||||
|  | ||||
|     // There is no 1-1 mapping between signals and windows exceptions. | ||||
|     // Windows can easily distinguish between SO and SigSegV, | ||||
|     // but SigInt, SigTerm, etc are handled differently. | ||||
|     SignalDefs signalDefs[] = { | ||||
|         { EXCEPTION_ILLEGAL_INSTRUCTION,  "SIGILL - Illegal instruction signal" }, | ||||
|         { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" }, | ||||
|         { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" }, | ||||
|         { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" }, | ||||
|     }; | ||||
|  | ||||
|     LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { | ||||
|         for (int i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { | ||||
|             if (ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) { | ||||
|                 reportFatal(signalDefs[i].name); | ||||
|             } | ||||
|         } | ||||
|         // If its not an exception we care about, pass it along. | ||||
|         // This stops us from eating debugger breaks etc. | ||||
|         return EXCEPTION_CONTINUE_SEARCH; | ||||
|     } | ||||
|  | ||||
|     FatalConditionHandler::FatalConditionHandler() { | ||||
|         isSet = true; | ||||
|         // 32k seems enough for Catch to handle stack overflow, | ||||
|         // but the value was found experimentally, so there is no strong guarantee | ||||
|         guaranteeSize = 32 * 1024; | ||||
|         exceptionHandlerHandle = nullptr; | ||||
|         // Register as first handler in current chain | ||||
|         exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException); | ||||
|         // Pass in guarantee size to be filled | ||||
|         SetThreadStackGuarantee(&guaranteeSize); | ||||
|     } | ||||
|  | ||||
|     void FatalConditionHandler::reset() { | ||||
|         if (isSet) { | ||||
|             // Unregister handler and restore the old guarantee | ||||
|             RemoveVectoredExceptionHandler(exceptionHandlerHandle); | ||||
|             SetThreadStackGuarantee(&guaranteeSize); | ||||
|             exceptionHandlerHandle = nullptr; | ||||
|             isSet = false; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     FatalConditionHandler::~FatalConditionHandler() { | ||||
|         reset(); | ||||
|     } | ||||
|  | ||||
| bool FatalConditionHandler::isSet = false; | ||||
| ULONG FatalConditionHandler::guaranteeSize = 0; | ||||
| PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr; | ||||
|  | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #  endif // CATCH_CONFIG_WINDOWS_SEH | ||||
|  | ||||
| #else // Not Windows - assumed to be POSIX compatible ////////////////////////// | ||||
|  | ||||
| #  if !defined(CATCH_CONFIG_POSIX_SIGNALS) | ||||
|  | ||||
| namespace Catch { | ||||
|     void FatalConditionHandler::reset() {} | ||||
| } | ||||
|  | ||||
|  | ||||
| #  else // CATCH_CONFIG_POSIX_SIGNALS is defined | ||||
|  | ||||
| #include <signal.h> | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     struct SignalDefs { | ||||
|         int id; | ||||
|         const char* name; | ||||
|     }; | ||||
|     SignalDefs signalDefs[] = { | ||||
|         { SIGINT,  "SIGINT - Terminal interrupt signal" }, | ||||
|         { SIGILL,  "SIGILL - Illegal instruction signal" }, | ||||
|         { SIGFPE,  "SIGFPE - Floating point error signal" }, | ||||
|         { SIGSEGV, "SIGSEGV - Segmentation violation signal" }, | ||||
|         { SIGTERM, "SIGTERM - Termination request signal" }, | ||||
|         { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" } | ||||
|     }; | ||||
|  | ||||
|  | ||||
|     void FatalConditionHandler::handleSignal( int sig ) { | ||||
|         std::string name = "<unknown signal>"; | ||||
|         for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { | ||||
|             SignalDefs &def = signalDefs[i]; | ||||
|             if (sig == def.id) { | ||||
|                 name = def.name; | ||||
|                 break; | ||||
|             } | ||||
|         } | ||||
|         reset(); | ||||
|         reportFatal(name); | ||||
|         raise( sig ); | ||||
|     } | ||||
|  | ||||
|     FatalConditionHandler::FatalConditionHandler() { | ||||
|         isSet = true; | ||||
|         stack_t sigStack; | ||||
|         sigStack.ss_sp = altStackMem; | ||||
|         sigStack.ss_size = SIGSTKSZ; | ||||
|         sigStack.ss_flags = 0; | ||||
|         sigaltstack(&sigStack, &oldSigStack); | ||||
|         struct sigaction sa = { }; | ||||
|  | ||||
|         sa.sa_handler = handleSignal; | ||||
|         sa.sa_flags = SA_ONSTACK; | ||||
|         for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) { | ||||
|             sigaction(signalDefs[i].id, &sa, &oldSigActions[i]); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  | ||||
|     FatalConditionHandler::~FatalConditionHandler() { | ||||
|         reset(); | ||||
|     } | ||||
|  | ||||
|     void FatalConditionHandler::reset() { | ||||
|         if( isSet ) { | ||||
|             // Set signals back to previous values -- hopefully nobody overwrote them in the meantime | ||||
|             for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) { | ||||
|                 sigaction(signalDefs[i].id, &oldSigActions[i], nullptr); | ||||
|             } | ||||
|             // Return the old stack | ||||
|             sigaltstack(&oldSigStack, nullptr); | ||||
|             isSet = false; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     bool FatalConditionHandler::isSet = false; | ||||
|     struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; | ||||
|     stack_t FatalConditionHandler::oldSigStack = {}; | ||||
|     char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; | ||||
|  | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #  endif // CATCH_CONFIG_POSIX_SIGNALS | ||||
|  | ||||
| #endif // not Windows | ||||
							
								
								
									
										92
									
								
								include/internal/catch_fatal_condition.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								include/internal/catch_fatal_condition.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,92 @@ | ||||
| /* | ||||
|  *  Created by Phil on 21/08/2014 | ||||
|  *  Copyright 2014 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) | ||||
|  * | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED | ||||
|  | ||||
| #include <string> | ||||
| #include "catch_platform.h" | ||||
| #include "catch_compiler_capabilities.h" | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     // Report the error condition | ||||
|     void reportFatal( std::string const& message ); | ||||
|      | ||||
| } // namespace Catch | ||||
|  | ||||
| #if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// | ||||
| #include "catch_windows_h_proxy.h" | ||||
|  | ||||
| #  if !defined ( CATCH_CONFIG_WINDOWS_SEH ) | ||||
|  | ||||
| namespace Catch { | ||||
|     struct FatalConditionHandler { | ||||
|         void reset(); | ||||
|     }; | ||||
| } | ||||
|  | ||||
| #  else // CATCH_CONFIG_WINDOWS_SEH is defined | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     struct FatalConditionHandler { | ||||
|  | ||||
|         static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo); | ||||
|         FatalConditionHandler(); | ||||
|         static void reset(); | ||||
|         ~FatalConditionHandler(); | ||||
|  | ||||
|     private: | ||||
|         static bool isSet; | ||||
|         static ULONG guaranteeSize; | ||||
|         static PVOID exceptionHandlerHandle; | ||||
|     }; | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #  endif // CATCH_CONFIG_WINDOWS_SEH | ||||
|  | ||||
| #else // Not Windows - assumed to be POSIX compatible ////////////////////////// | ||||
|  | ||||
| #  if !defined(CATCH_CONFIG_POSIX_SIGNALS) | ||||
|  | ||||
| namespace Catch { | ||||
|     struct FatalConditionHandler { | ||||
|         void reset(); | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #  else // CATCH_CONFIG_POSIX_SIGNALS is defined | ||||
|  | ||||
| #include <signal.h> | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     struct FatalConditionHandler { | ||||
|  | ||||
|         static bool isSet; | ||||
|         static struct sigaction oldSigActions[];// [sizeof(signalDefs) / sizeof(SignalDefs)]; | ||||
|         static stack_t oldSigStack; | ||||
|         static char altStackMem[]; | ||||
|  | ||||
|         static void handleSignal( int sig ); | ||||
|  | ||||
|         FatalConditionHandler(); | ||||
|         ~FatalConditionHandler(); | ||||
|         static void reset(); | ||||
|     }; | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #  endif // CATCH_CONFIG_POSIX_SIGNALS | ||||
|  | ||||
| #endif // not Windows | ||||
|  | ||||
| #endif // TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED | ||||
| @@ -1,200 +0,0 @@ | ||||
| /* | ||||
|  *  Created by Phil on 21/08/2014 | ||||
|  *  Copyright 2014 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) | ||||
|  * | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED | ||||
|  | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     // Report the error condition | ||||
|     inline void reportFatal( std::string const& message ) { | ||||
|         IContext& context = Catch::getCurrentContext(); | ||||
|         IResultCapture* resultCapture = context.getResultCapture(); | ||||
|         resultCapture->handleFatalErrorCondition( message ); | ||||
|     } | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// | ||||
| #include "catch_windows_h_proxy.h" | ||||
|  | ||||
| #  if !defined ( CATCH_CONFIG_WINDOWS_SEH ) | ||||
|  | ||||
| namespace Catch { | ||||
|     struct FatalConditionHandler { | ||||
|         void reset() {} | ||||
|     }; | ||||
| } | ||||
|  | ||||
| #  else // CATCH_CONFIG_WINDOWS_SEH is defined | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     struct SignalDefs { DWORD id; const char* name; }; | ||||
|     extern SignalDefs signalDefs[]; | ||||
|     // There is no 1-1 mapping between signals and windows exceptions. | ||||
|     // Windows can easily distinguish between SO and SigSegV, | ||||
|     // but SigInt, SigTerm, etc are handled differently. | ||||
|     SignalDefs signalDefs[] = { | ||||
|         { EXCEPTION_ILLEGAL_INSTRUCTION,  "SIGILL - Illegal instruction signal" }, | ||||
|         { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" }, | ||||
|         { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" }, | ||||
|         { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" }, | ||||
|     }; | ||||
|  | ||||
|     struct FatalConditionHandler { | ||||
|  | ||||
|         static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { | ||||
|             for (int i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { | ||||
|                 if (ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) { | ||||
|                     reportFatal(signalDefs[i].name); | ||||
|                 } | ||||
|             } | ||||
|             // If its not an exception we care about, pass it along. | ||||
|             // This stops us from eating debugger breaks etc. | ||||
|             return EXCEPTION_CONTINUE_SEARCH; | ||||
|         } | ||||
|  | ||||
|         FatalConditionHandler() { | ||||
|             isSet = true; | ||||
|             // 32k seems enough for Catch to handle stack overflow, | ||||
|             // but the value was found experimentally, so there is no strong guarantee | ||||
|             guaranteeSize = 32 * 1024; | ||||
|             exceptionHandlerHandle = nullptr; | ||||
|             // Register as first handler in current chain | ||||
|             exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException); | ||||
|             // Pass in guarantee size to be filled | ||||
|             SetThreadStackGuarantee(&guaranteeSize); | ||||
|         } | ||||
|  | ||||
|         static void reset() { | ||||
|             if (isSet) { | ||||
|                 // Unregister handler and restore the old guarantee | ||||
|                 RemoveVectoredExceptionHandler(exceptionHandlerHandle); | ||||
|                 SetThreadStackGuarantee(&guaranteeSize); | ||||
|                 exceptionHandlerHandle = nullptr; | ||||
|                 isSet = false; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         ~FatalConditionHandler() { | ||||
|             reset(); | ||||
|         } | ||||
|     private: | ||||
|         static bool isSet; | ||||
|         static ULONG guaranteeSize; | ||||
|         static PVOID exceptionHandlerHandle; | ||||
|     }; | ||||
|  | ||||
|     bool FatalConditionHandler::isSet = false; | ||||
|     ULONG FatalConditionHandler::guaranteeSize = 0; | ||||
|     PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr; | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #  endif // CATCH_CONFIG_WINDOWS_SEH | ||||
|  | ||||
| #else // Not Windows - assumed to be POSIX compatible ////////////////////////// | ||||
|  | ||||
| #  if !defined(CATCH_CONFIG_POSIX_SIGNALS) | ||||
|  | ||||
| namespace Catch { | ||||
|     struct FatalConditionHandler { | ||||
|         void reset() {} | ||||
|     }; | ||||
| } | ||||
|  | ||||
|  | ||||
| #  else // CATCH_CONFIG_POSIX_SIGNALS is defined | ||||
|  | ||||
| #include <signal.h> | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     struct SignalDefs { | ||||
|         int id; | ||||
|         const char* name; | ||||
|     }; | ||||
|     extern SignalDefs signalDefs[]; | ||||
|     SignalDefs signalDefs[] = { | ||||
|             { SIGINT,  "SIGINT - Terminal interrupt signal" }, | ||||
|             { SIGILL,  "SIGILL - Illegal instruction signal" }, | ||||
|             { SIGFPE,  "SIGFPE - Floating point error signal" }, | ||||
|             { SIGSEGV, "SIGSEGV - Segmentation violation signal" }, | ||||
|             { SIGTERM, "SIGTERM - Termination request signal" }, | ||||
|             { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" } | ||||
|     }; | ||||
|  | ||||
|     struct FatalConditionHandler { | ||||
|  | ||||
|         static bool isSet; | ||||
|         static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)]; | ||||
|         static stack_t oldSigStack; | ||||
|         static char altStackMem[SIGSTKSZ]; | ||||
|  | ||||
|         static void handleSignal( int sig ) { | ||||
|             std::string name = "<unknown signal>"; | ||||
|             for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { | ||||
|                 SignalDefs &def = signalDefs[i]; | ||||
|                 if (sig == def.id) { | ||||
|                     name = def.name; | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|             reset(); | ||||
|             reportFatal(name); | ||||
|             raise( sig ); | ||||
|         } | ||||
|  | ||||
|         FatalConditionHandler() { | ||||
|             isSet = true; | ||||
|             stack_t sigStack; | ||||
|             sigStack.ss_sp = altStackMem; | ||||
|             sigStack.ss_size = SIGSTKSZ; | ||||
|             sigStack.ss_flags = 0; | ||||
|             sigaltstack(&sigStack, &oldSigStack); | ||||
|             struct sigaction sa = { 0 }; | ||||
|  | ||||
|             sa.sa_handler = handleSignal; | ||||
|             sa.sa_flags = SA_ONSTACK; | ||||
|             for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) { | ||||
|                 sigaction(signalDefs[i].id, &sa, &oldSigActions[i]); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|  | ||||
|         ~FatalConditionHandler() { | ||||
|             reset(); | ||||
|         } | ||||
|         static void reset() { | ||||
|             if( isSet ) { | ||||
|                 // Set signals back to previous values -- hopefully nobody overwrote them in the meantime | ||||
|                 for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) { | ||||
|                     sigaction(signalDefs[i].id, &oldSigActions[i], nullptr); | ||||
|                 } | ||||
|                 // Return the old stack | ||||
|                 sigaltstack(&oldSigStack, nullptr); | ||||
|                 isSet = false; | ||||
|             } | ||||
|         } | ||||
|     }; | ||||
|  | ||||
|     bool FatalConditionHandler::isSet = false; | ||||
|     struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; | ||||
|     stack_t FatalConditionHandler::oldSigStack = {}; | ||||
|     char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; | ||||
|  | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #  endif // CATCH_CONFIG_POSIX_SIGNALS | ||||
|  | ||||
| #endif // not Windows | ||||
|  | ||||
| #endif // TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED | ||||
| @@ -17,33 +17,34 @@ | ||||
| #endif | ||||
|  | ||||
| #include "../catch_session.hpp" | ||||
| #include "catch_registry_hub.hpp" | ||||
| #include "catch_notimplemented_exception.hpp" | ||||
| #include "catch_context_impl.hpp" | ||||
| #include "catch_console_colour_impl.hpp" | ||||
| #include "catch_assertionresult.hpp" | ||||
| #include "catch_test_case_info.hpp" | ||||
| #include "catch_stream.hpp" | ||||
| #include "catch_test_spec.hpp" | ||||
| #include "catch_version.hpp" | ||||
| #include "catch_message.hpp" | ||||
| #include "catch_timer.hpp" | ||||
| #include "catch_common.hpp" | ||||
| #include "catch_section.hpp" | ||||
| #include "catch_debugger.hpp" | ||||
| #include "catch_tostring.hpp" | ||||
| #include "catch_result_builder.hpp" | ||||
| #include "catch_tag_alias_registry.hpp" | ||||
| #include "catch_test_case_tracker.hpp" | ||||
| #include "catch_matchers_string.hpp" | ||||
| #include "catch_startup_exception_registry.hpp" | ||||
|  | ||||
| // These files are not included in the full (not single include) project | ||||
| // as they are compiled as proper cpp files | ||||
| #ifndef CATCH_CONFIG_FULL_PROJECT | ||||
| #   include "catch_assertionresult.cpp" | ||||
| #   include "catch_common.cpp" | ||||
| #   include "catch_console_colour.cpp" | ||||
| #   include "catch_context.cpp" | ||||
| #   include "catch_debugger.cpp" | ||||
| #   include "catch_matchers_string.cpp" | ||||
| #   include "catch_message.cpp" | ||||
| #   include "catch_notimplemented_exception.cpp" | ||||
| #   include "catch_registry_hub.cpp" | ||||
| #   include "catch_result_builder.hpp" | ||||
| #   include "catch_section.cpp" | ||||
| #   include "catch_startup_exception_registry.cpp" | ||||
| #   include "catch_stringref.cpp" | ||||
| #   include "catch_string.cpp" | ||||
| #   include "catch_stringbuilder.cpp" | ||||
| #   include "catch_stringdata.cpp" | ||||
| #   include "catch_tag_alias_registry.cpp" | ||||
| #   include "catch_test_case_info.cpp" | ||||
| #   include "catch_timer.cpp" | ||||
| #   include "catch_tostring.cpp" | ||||
| #   include "catch_version.cpp" | ||||
| #endif | ||||
|  | ||||
| #include "../reporters/catch_reporter_multi.hpp" | ||||
| @@ -88,8 +89,6 @@ namespace Catch { | ||||
|     IConfig::~IConfig() {} | ||||
|     XmlReporter::~XmlReporter() {} | ||||
|     JunitReporter::~JunitReporter() {} | ||||
|     TestRegistry::~TestRegistry() {} | ||||
|     FreeFunctionTestCase::~FreeFunctionTestCase() {} | ||||
|     WildcardPattern::~WildcardPattern() {} | ||||
|     TestSpec::Pattern::~Pattern() {} | ||||
|     TestSpec::NamePattern::~NamePattern() {} | ||||
|   | ||||
| @@ -10,6 +10,8 @@ | ||||
|  | ||||
| #include "catch_common.h" | ||||
|  | ||||
| #include <vector> | ||||
|  | ||||
| namespace Catch { | ||||
| namespace Matchers { | ||||
|     namespace Impl { | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|  * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 | ||||
|  */ | ||||
| 
 | ||||
| #include "catch_matchers.hpp" | ||||
| #include "catch_matchers_string.h" | ||||
| 
 | ||||
| namespace Catch { | ||||
| namespace Matchers { | ||||
| @@ -5,10 +5,9 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_message.h" | ||||
| #include "catch_interfaces_capture.h" | ||||
| 
 | ||||
| namespace Catch { | ||||
| 
 | ||||
| @@ -21,12 +20,28 @@ namespace Catch { | ||||
|         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( std::string const& macroName, | ||||
|                                            SourceLineInfo const& lineInfo, | ||||
|                                            ResultWas::OfType type ) | ||||
|         :m_info(macroName, lineInfo, type) {} | ||||
| 
 | ||||
|     ////////////////////////////////////////////////////////////////////////////
 | ||||
| 
 | ||||
| 
 | ||||
|     ScopedMessage::ScopedMessage( MessageBuilder const& builder ) | ||||
|     : m_info( builder.m_info ) | ||||
|     { | ||||
| @@ -45,5 +60,3 @@ namespace Catch { | ||||
| 
 | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED
 | ||||
| @@ -25,12 +25,8 @@ namespace Catch { | ||||
|         std::string message; | ||||
|         unsigned int sequence; | ||||
|  | ||||
|         bool operator == ( MessageInfo const& other ) const { | ||||
|             return sequence == other.sequence; | ||||
|         } | ||||
|         bool operator < ( MessageInfo const& other ) const { | ||||
|             return sequence < other.sequence; | ||||
|         } | ||||
|         bool operator == ( MessageInfo const& other ) const; | ||||
|         bool operator < ( MessageInfo const& other ) const; | ||||
|     private: | ||||
|         static unsigned int globalCount; | ||||
|     }; | ||||
| @@ -38,9 +34,7 @@ namespace Catch { | ||||
|     struct MessageBuilder { | ||||
|         MessageBuilder( std::string const& macroName, | ||||
|                         SourceLineInfo const& lineInfo, | ||||
|                         ResultWas::OfType type ) | ||||
|         : m_info( macroName, lineInfo, type ) | ||||
|         {} | ||||
|                         ResultWas::OfType type ); | ||||
|  | ||||
|         template<typename T> | ||||
|         MessageBuilder& operator << ( T const& value ) { | ||||
|   | ||||
| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_notimplemented_exception.h" | ||||
| #include <sstream> | ||||
| @@ -26,5 +24,3 @@ namespace Catch { | ||||
|     } | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED
 | ||||
| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_interfaces_registry_hub.h" | ||||
| 
 | ||||
| @@ -96,5 +94,3 @@ namespace Catch { | ||||
| 
 | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED
 | ||||
| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_result_builder.h" | ||||
| #include "catch_context.h" | ||||
| @@ -14,8 +12,11 @@ | ||||
| #include "catch_interfaces_runner.h" | ||||
| #include "catch_interfaces_capture.h" | ||||
| #include "catch_interfaces_registry_hub.h" | ||||
| #include "catch_matchers_string.h" | ||||
| #include "catch_wildcard_pattern.hpp" | ||||
| 
 | ||||
| #include <cassert> | ||||
| 
 | ||||
| namespace Catch { | ||||
| 
 | ||||
|     ResultBuilder::ResultBuilder(   char const* macroName, | ||||
| @@ -158,5 +159,3 @@ namespace Catch { | ||||
|     } | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED
 | ||||
| @@ -20,7 +20,7 @@ | ||||
| #include "catch_test_case_tracker.hpp" | ||||
| #include "catch_timer.h" | ||||
| #include "catch_result_builder.h" | ||||
| #include "catch_fatal_condition.hpp" | ||||
| #include "catch_fatal_condition.h" | ||||
|  | ||||
| #include <set> | ||||
| #include <string> | ||||
|   | ||||
| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_section.h" | ||||
| #include "catch_capture.hpp" | ||||
| @@ -54,5 +52,3 @@ namespace Catch { | ||||
| 
 | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED
 | ||||
| @@ -5,11 +5,11 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_SECTION_INFO_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_SECTION_INFO_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_section_info.h" | ||||
| 
 | ||||
| #include <vector> | ||||
| 
 | ||||
| namespace Catch { | ||||
| 
 | ||||
|     class RunningSection { | ||||
| @@ -75,7 +75,7 @@ namespace Catch { | ||||
|         RunningSection* findOrAddSubSection( std::string const& name, bool& changed ) { | ||||
|             for( auto subSection : m_subSections ) | ||||
|                 if( subSection->getName() == name ) | ||||
|                     return *it; | ||||
|                     return subSection; | ||||
|             RunningSection* subSection = new RunningSection( this, name ); | ||||
|             m_subSections.push_back( subSection ); | ||||
|             m_state = Branch; | ||||
| @@ -102,5 +102,3 @@ namespace Catch { | ||||
|         SubSections m_subSections; | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_SECTION_INFO_HPP_INCLUDED
 | ||||
| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_startup_exception_registry.h" | ||||
| 
 | ||||
| @@ -20,5 +18,3 @@ namespace Catch { | ||||
|     } | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED
 | ||||
| @@ -9,7 +9,6 @@ | ||||
| #ifndef TWOBLUECUBES_CATCH_STREAM_H_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED | ||||
|  | ||||
| #include "catch_compiler_capabilities.h" | ||||
| #include "catch_streambuf.h" | ||||
|  | ||||
| #include <streambuf> | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
| #ifndef TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED | ||||
|  | ||||
| #include "catch_common.h" | ||||
| #include "catch_stream.h" | ||||
| #include "catch_debugger.h" | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,6 @@ | ||||
|  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||||
|  */ | ||||
|  | ||||
|  | ||||
| #include "catch_stringdata.h" | ||||
| #include "catch_stringref.h" | ||||
|  | ||||
|   | ||||
| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_tag_alias_registry.h" | ||||
| #include "catch_console_colour.hpp" | ||||
| @@ -64,5 +62,3 @@ namespace Catch { | ||||
|     } | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED
 | ||||
| @@ -5,8 +5,6 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_test_spec.hpp" | ||||
| #include "catch_test_case_info.h" | ||||
| @@ -161,5 +159,3 @@ namespace Catch { | ||||
|     } | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED
 | ||||
| @@ -12,6 +12,7 @@ | ||||
| #include "catch_test_case_info.h" | ||||
| #include "catch_test_spec.hpp" | ||||
| #include "catch_context.h" | ||||
| #include "catch_interfaces_config.h" | ||||
|  | ||||
| #include <vector> | ||||
| #include <set> | ||||
| @@ -119,6 +120,9 @@ namespace Catch { | ||||
|         std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised | ||||
|     }; | ||||
|  | ||||
|     TestRegistry::~TestRegistry() {} | ||||
|  | ||||
|  | ||||
|     /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
|     class FreeFunctionTestCase : public ITestCase { | ||||
| @@ -136,6 +140,9 @@ namespace Catch { | ||||
|         TestFunction m_fun; | ||||
|     }; | ||||
|  | ||||
|     FreeFunctionTestCase::~FreeFunctionTestCase() {} | ||||
|  | ||||
|  | ||||
|     inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) { | ||||
|         std::string className = classOrQualifiedMethodName; | ||||
|         if( startsWith( className, '&' ) ) | ||||
|   | ||||
| @@ -5,11 +5,10 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_tostring.h" | ||||
| #include "catch_interfaces_config.h" | ||||
| #include "catch_context.h" | ||||
| 
 | ||||
| namespace Catch { | ||||
| 
 | ||||
| @@ -226,5 +225,3 @@ std::string StringMaker<NSObject*>::convert(NSObject* nsObject) { | ||||
| #endif | ||||
| 
 | ||||
| } // end namespace Catch
 | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED
 | ||||
| @@ -5,10 +5,9 @@ | ||||
|  *  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)
 | ||||
|  */ | ||||
| #ifndef TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED | ||||
| 
 | ||||
| #include "catch_version.h" | ||||
| #include <ostream> | ||||
| 
 | ||||
| namespace Catch { | ||||
| 
 | ||||
| @@ -37,11 +36,9 @@ namespace Catch { | ||||
|         return os; | ||||
|     } | ||||
| 
 | ||||
|     inline Version libraryVersion() { | ||||
|     Version libraryVersion() { | ||||
|         static Version version( 2, 0, 0, "develop", 1 ); | ||||
|         return version; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
 | ||||
| @@ -8,6 +8,8 @@ | ||||
| #ifndef TWOBLUECUBES_CATCH_VERSION_H_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED | ||||
|  | ||||
| #include <iosfwd> | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     // Versioning information | ||||
| @@ -32,7 +34,7 @@ namespace Catch { | ||||
|         void operator=( Version const& ); | ||||
|     }; | ||||
|  | ||||
|     inline Version libraryVersion(); | ||||
|     Version libraryVersion(); | ||||
| } | ||||
|  | ||||
| #endif // TWOBLUECUBES_CATCH_VERSION_H_INCLUDED | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
| #define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED | ||||
|  | ||||
| #include "../internal/catch_interfaces_reporter.h" | ||||
| #include "../internal/catch_errno_guard.hpp" | ||||
| #include "../internal/catch_errno_guard.h" | ||||
|  | ||||
| #include <cstring> | ||||
| #include <cfloat> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský