mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
feat(tests): add whitelist for compile flag check (#5356)
This commit is contained in:
parent
ff897e3b6f
commit
9a0ada3ebf
@ -11,11 +11,18 @@ project(lvgl_tests LANGUAGES C CXX)
|
|||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
set(FLAG_CHECK_WHITELIST --coverage -fsanitize=address)
|
||||||
|
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
function(filter_compiler_options lang options_out)
|
function(filter_compiler_options lang options_out)
|
||||||
set(options ${ARGN})
|
set(options ${ARGN})
|
||||||
foreach(option ${options})
|
foreach(option ${options})
|
||||||
|
if (option IN_LIST FLAG_CHECK_WHITELIST)
|
||||||
|
list(APPEND ${options_out} ${option})
|
||||||
|
continue()
|
||||||
|
endif ()
|
||||||
|
|
||||||
string(TOUPPER FLAG_SUPPORTED_FOR_${lang}_${option} option_var_name)
|
string(TOUPPER FLAG_SUPPORTED_FOR_${lang}_${option} option_var_name)
|
||||||
|
|
||||||
if (${lang} STREQUAL C)
|
if (${lang} STREQUAL C)
|
||||||
@ -94,14 +101,12 @@ elseif (OPTIONS_FULL_32BIT)
|
|||||||
set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_FULL_32BIT})
|
set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_FULL_32BIT})
|
||||||
elseif (OPTIONS_TEST_SYSHEAP)
|
elseif (OPTIONS_TEST_SYSHEAP)
|
||||||
set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_TEST_SYSHEAP} -fsanitize=address -fsanitize=leak -fsanitize=undefined --coverage)
|
set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_TEST_SYSHEAP} -fsanitize=address -fsanitize=leak -fsanitize=undefined --coverage)
|
||||||
filter_compiler_options (C TEST_LIBS --coverage -fsanitize=leak -fsanitize=undefined)
|
filter_compiler_options (C TEST_LIBS --coverage -fsanitize=address -fsanitize=leak -fsanitize=undefined)
|
||||||
list(APPEND TEST_LIBS -fsanitize=address)
|
|
||||||
set (LV_CONF_BUILD_DISABLE_EXAMPLES ON)
|
set (LV_CONF_BUILD_DISABLE_EXAMPLES ON)
|
||||||
set (ENABLE_TESTS ON)
|
set (ENABLE_TESTS ON)
|
||||||
elseif (OPTIONS_TEST_DEFHEAP)
|
elseif (OPTIONS_TEST_DEFHEAP)
|
||||||
set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_TEST_DEFHEAP})
|
set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_TEST_DEFHEAP})
|
||||||
filter_compiler_options (C TEST_LIBS --coverage -fsanitize=leak -fsanitize=undefined)
|
filter_compiler_options (C TEST_LIBS --coverage -fsanitize=address -fsanitize=leak -fsanitize=undefined)
|
||||||
list(APPEND TEST_LIBS -fsanitize=address)
|
|
||||||
set (LV_CONF_BUILD_DISABLE_EXAMPLES ON)
|
set (LV_CONF_BUILD_DISABLE_EXAMPLES ON)
|
||||||
set (ENABLE_TESTS ON)
|
set (ENABLE_TESTS ON)
|
||||||
elseif (OPTIONS_TEST_MEMORYCHECK)
|
elseif (OPTIONS_TEST_MEMORYCHECK)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user