Compare commits
2 Commits
26eced86d8
...
master
Author | SHA1 | Date | |
---|---|---|---|
f1abee3365 | |||
dfa7faf459 |
@ -24,7 +24,6 @@
|
|||||||
# 2015 RWTH Aachen University, Federal Republic of Germany
|
# 2015 RWTH Aachen University, Federal Republic of Germany
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# project information
|
# project information
|
||||||
#
|
#
|
||||||
@ -35,15 +34,11 @@ cmake_minimum_required(VERSION 2.8)
|
|||||||
# project name
|
# project name
|
||||||
project("CMake-sanitizers")
|
project("CMake-sanitizers")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# cmake configuration
|
# cmake configuration
|
||||||
#
|
#
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# add tests
|
# add tests
|
||||||
#
|
#
|
||||||
|
@ -132,7 +132,7 @@ function (sanitizer_check_compiler_flags FLAG_CANDIDATES NAME PREFIX)
|
|||||||
if (${PREFIX}_FLAG_DETECTED)
|
if (${PREFIX}_FLAG_DETECTED)
|
||||||
# If compiler is a GNU compiler, search for static flag, if
|
# If compiler is a GNU compiler, search for static flag, if
|
||||||
# SANITIZE_LINK_STATIC is enabled.
|
# SANITIZE_LINK_STATIC is enabled.
|
||||||
if (SANITIZE_LINK_STATIC AND (${COMPILER} STREQUAL "GNU"))
|
if (SANITIZE_LINK_STATIC AND (COMPILER STREQUAL "GNU"))
|
||||||
string(TOLOWER ${PREFIX} PREFIX_lower)
|
string(TOLOWER ${PREFIX} PREFIX_lower)
|
||||||
sanitizer_check_compiler_flag(
|
sanitizer_check_compiler_flag(
|
||||||
"-static-lib${PREFIX_lower}" ${LANG}
|
"-static-lib${PREFIX_lower}" ${LANG}
|
||||||
|
@ -26,24 +26,22 @@
|
|||||||
|
|
||||||
# Function to add testcases.
|
# Function to add testcases.
|
||||||
function(add_testcase TESTNAME SOURCEFILES)
|
function(add_testcase TESTNAME SOURCEFILES)
|
||||||
# remove ${TESTNAME} from ${ARGV} to use ${ARGV} as ${SOURCEFILES}
|
# remove ${TESTNAME} from ${ARGV} to use ${ARGV} as ${SOURCEFILES}
|
||||||
list(REMOVE_AT ARGV 0)
|
list(REMOVE_AT ARGV 0)
|
||||||
|
|
||||||
# add a new executable
|
# add a new executable
|
||||||
add_executable(${TESTNAME} ${ARGV})
|
add_executable(${TESTNAME} ${ARGV})
|
||||||
|
|
||||||
# add a testcase for executable
|
# add a testcase for executable
|
||||||
add_test(${TESTNAME} ${TESTNAME})
|
add_test(${TESTNAME} ${TESTNAME})
|
||||||
endfunction(add_testcase)
|
endfunction(add_testcase)
|
||||||
|
|
||||||
# Function to add testcases with asan enabled.
|
# Function to add testcases with asan enabled.
|
||||||
function(add_sanitized_testcase TESTNAME SOURCEFILES)
|
function(add_sanitized_testcase TESTNAME SOURCEFILES)
|
||||||
add_testcase(${TESTNAME} ${SOURCEFILES})
|
add_testcase(${TESTNAME} ${SOURCEFILES})
|
||||||
add_sanitizers(${TESTNAME})
|
add_sanitizers(${TESTNAME})
|
||||||
endfunction(add_sanitized_testcase)
|
endfunction(add_sanitized_testcase)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set(SANITIZE_ADDRESS TRUE)
|
set(SANITIZE_ADDRESS TRUE)
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -51,17 +49,10 @@ set(SANITIZE_ADDRESS TRUE)
|
|||||||
#
|
#
|
||||||
find_package(Sanitizers)
|
find_package(Sanitizers)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# add testcases
|
# add testcases
|
||||||
#
|
#
|
||||||
add_sanitized_testcase("asan_test_cpp" asan_test.cpp)
|
add_sanitized_testcase("asan_test_cpp" asan_test.cpp)
|
||||||
add_sanitized_testcase("shortest_ext_test_cpp" shortest.ext.test.cpp)
|
add_sanitized_testcase("shortest_ext_test_cpp" shortest.ext.test.cpp)
|
||||||
|
|
||||||
set_tests_properties(
|
set_tests_properties("asan_test_cpp" "shortest_ext_test_cpp" PROPERTIES WILL_FAIL TRUE)
|
||||||
"asan_test_cpp"
|
|
||||||
"shortest_ext_test_cpp"
|
|
||||||
PROPERTIES
|
|
||||||
WILL_FAIL TRUE
|
|
||||||
)
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user