tests: Disable -Werror for tests

This way we can still run tests with some compiler warnings
This commit is contained in:
patrick96 2018-05-15 14:58:09 +02:00 committed by Patrick Ziegler
parent 4cb0b18389
commit a3786be26a

View File

@ -35,6 +35,10 @@ add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
# }}} # }}}
# Disable errors for warnings so that we can run tests even with some warnings
string(REGEX REPLACE "-Werror[^ ]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "-pedantic-errors" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
function(unit_test file tests) function(unit_test file tests)
set(multi_value_args SOURCES) set(multi_value_args SOURCES)
@ -65,12 +69,17 @@ function(unit_test file tests)
endfunction() endfunction()
unit_test(utils/color unit_tests) unit_test(utils/color unit_tests)
unit_test(utils/math unit_tests) unit_test(utils/math unit_tests)
unit_test(utils/memory unit_tests) unit_test(utils/memory unit_tests)
unit_test(utils/scope unit_tests) unit_test(utils/scope unit_tests)
unit_test(utils/string unit_tests unit_test(utils/string unit_tests
SOURCES SOURCES
utils/string.cpp) utils/string.cpp)
unit_test(utils/file unit_tests unit_test(utils/file unit_tests
SOURCES SOURCES
utils/command.cpp utils/command.cpp
@ -85,6 +94,7 @@ unit_test(components/command_line unit_tests
SOURCES SOURCES
components/command_line.cpp components/command_line.cpp
utils/string.cpp) utils/string.cpp)
unit_test(components/bar unit_tests) unit_test(components/bar unit_tests)
unit_test(components/builder unit_tests unit_test(components/builder unit_tests