Merge pull request #126 from pjohnmeyer/up_msvc_warning_levels

Up MSVC warning levels
This commit is contained in:
Patrick Johnmeyer 2016-08-30 20:45:20 -05:00 • committed by GitHub
commit 1d0e157c5a
2 changed files with 15 additions and 0 deletions

View file

@ -7,6 +7,9 @@ option(UTPP_USE_PLUS_SIGN
option(UTPP_INCLUDE_TESTS_IN_BUILD
"Set this to OFF if you do not wish to automatically build or run unit tests as part of the default cmake --build"
ON)
option(UTPP_AMPLIFY_WARNINGS
"Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler"
ON)
if(MSVC14 OR MSVC12)
# has the support we need
@ -23,6 +26,15 @@ else()
endif()
endif()
# up warning level for project
if (${UTPP_AMPLIFY_WARNINGS})
# instead of getting compiler specific, we're going to try making an assumption that an existing /W# means
# we are dealing with an MSVC or MSVC-like compiler (e.g. Intel on Windows)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
endif()
endif()
# get the main sources
file(GLOB headers_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.h)
file(GLOB sources_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.cpp)

View file

@ -19,6 +19,9 @@ namespace UnitTest {
bool Next();
private:
RequiredCheckTestReporter(RequiredCheckTestReporter const&);
RequiredCheckTestReporter& operator =(RequiredCheckTestReporter const&);
TestResults& m_results;
TestReporter* m_originalTestReporter;
ThrowingTestReporter m_throwingReporter;