1 #ifndef UNITTEST_CONFIG_H 2 #define UNITTEST_CONFIG_H 3 4 // Standard defines documented here: http://predef.sourceforge.net 5 6 #if defined(_MSC_VER) 7 #ifndef _CRT_SECURE_NO_WARNINGS 8 #define _CRT_SECURE_NO_WARNINGS 9 #endif 10 #pragma warning(disable:4702) // unreachable code 11 #pragma warning(disable:4722) // destructor never returns, potential memory leak 12 13 #if (_MSC_VER == 1200) // VC6 14 #define UNITTEST_COMPILER_IS_MSVC6 15 #pragma warning(disable:4786) 16 #pragma warning(disable:4290) 17 #endif 18 19 #ifdef _USRDLL 20 #define UNITTEST_WIN32_DLL 21 #endif 22 #define UNITTEST_WIN32 23 #endif 24 25 #if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \ 26 defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) 27 #define UNITTEST_POSIX 28 #endif 29 30 #if defined(__MINGW32__) 31 #define UNITTEST_MINGW 32 #endif 33 34 35 // By default, MemoryOutStream is implemented in terms of std::ostringstream. 36 // This is useful if you are using the CHECK macros on objects that have something like this defined: 37 // std::ostringstream& operator<<(std::ostringstream& s, const YourObject& value) 38 // 39 // On the other hand, it can be more expensive. 40 // Un-comment this line to use the custom MemoryOutStream (no deps on std::ostringstream). 41 42 // #define UNITTEST_USE_CUSTOM_STREAMS 43 44 // Developer note: This dual-macro setup is to preserve compatibility with UnitTest++ 1.4 users 45 // who may have used or defined UNITTEST_USE_CUSTOM_STREAMS outside of this configuration file, as 46 // well as Google Code HEAD users that may have used or defined 47 // UNITTEST_MEMORYOUTSTREAM_IS_STD_OSTRINGSTREAM outside of this configuration file. 48 #ifndef UNITTEST_USE_CUSTOM_STREAMS 49 #define UNITTEST_MEMORYOUTSTREAM_IS_STD_OSTRINGSTREAM 50 #endif 51 52 // DeferredTestReporter uses the STL to collect test results for subsequent export by reporters like 53 // XmlTestReporter. If you don't want to use this functionality, uncomment this line and no STL 54 // headers or code will be compiled into UnitTest++ 55 56 //#define UNITTEST_NO_DEFERRED_REPORTER 57 58 59 // By default, asserts that you report via UnitTest::ReportAssert() abort the current test and 60 // continue to the next one by throwing an exception, which unwinds the stack naturally, destroying 61 // all auto variables on its way back down. If you don't want to (or can't) use exceptions for your 62 // platform/compiler, uncomment this line. All exception code will be removed from UnitTest++, 63 // assert recovery will be done via setjmp/longjmp, and NO correct stack unwinding will happen! 64 65 #define UNITTEST_NO_EXCEPTIONS 66 67 68 // std namespace qualification: used for functions like strcpy that 69 // may live in std:: namespace (cstring header). 70 #if defined( UNITTEST_COMPILER_IS_MSVC6 ) 71 #define UNIITEST_NS_QUAL_STD(x) x 72 #else 73 #define UNIITEST_NS_QUAL_STD(x) ::std::x 74 #endif 75 76 #endif 77