[cmake]: Add option to control test building

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic6c6988dad82836cfb87113f2293bc9a2b1abd66
This commit is contained in:
Herman Chen
2020-06-22 17:43:11 +08:00
parent 48e07d877f
commit eb34769db7
7 changed files with 8 additions and 8 deletions

View File

@@ -61,7 +61,7 @@ set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
# ----------------------------------------------------------------------------
# enable test in this project
# ----------------------------------------------------------------------------
enable_testing()
option(BUILD_TEST "enable test binary building)" ON)
# ----------------------------------------------------------------------------
# System architecture detection

View File

@@ -10,7 +10,7 @@ macro(add_mpp_base_test module)
#message(STATUS "test_name : ${test_name}")
#message(STATUS "test_tag : ${test_tag}")
option(${test_tag} "Build base ${module} unit test" ON)
option(${test_tag} "Build base ${module} unit test" ${BUILD_TEST})
if(${test_tag})
add_executable(${test_name} ${test_name}.c)
target_link_libraries(${test_name} ${MPP_SHARED})

View File

@@ -10,7 +10,7 @@ macro(add_mpp_rc_test module)
set(test_name ${module}_test)
string(TOUPPER ${test_name} test_tag)
option(${test_tag} "Build rc ${module} unit test" ON)
option(${test_tag} "Build rc ${module} unit test" ${BUILD_TEST})
if(${test_tag})
add_executable(${test_name} ${test_name}.c)
target_link_libraries(${test_name} enc_rc mpp_base ${ASAN_LIB})

View File

@@ -3,7 +3,7 @@
# mpp/vproc/iep built-in unit test case
# ----------------------------------------------------------------------------
# iep unit test
option(IEP_TEST "Build base iep unit test" ON)
option(IEP_TEST "Build base iep unit test" ${BUILD_TEST})
add_executable(iep_test iep_test.cpp)
target_link_libraries(iep_test ${MPP_SHARED} utils)
set_target_properties(iep_test PROPERTIES FOLDER "mpp/vproc/iep")

View File

@@ -3,7 +3,7 @@
# mpp/vproc/rga built-in unit test case
# ----------------------------------------------------------------------------
# rga unit test
option(RGA_TEST "Build base rga unit test" ON)
option(RGA_TEST "Build base rga unit test" ${BUILD_TEST})
add_executable(rga_test rga_test.cpp)
target_link_libraries(rga_test ${MPP_SHARED} utils)
set_target_properties(rga_test PROPERTIES FOLDER "mpp/vproc/rga")

View File

@@ -10,7 +10,7 @@ macro(add_mpp_osal_test module)
#message(STATUS "test_name : ${test_name}")
#message(STATUS "test_tag : ${test_tag}")
option(${test_tag} "Build osal ${module} unit test" ON)
option(${test_tag} "Build osal ${module} unit test" ${BUILD_TEST})
if(${test_tag})
add_executable(${test_name} ${test_name}.c)
target_link_libraries(${test_name} ${MPP_SHARED})

View File

@@ -10,7 +10,7 @@ macro(add_mpp_test module)
#message(STATUS "test_name : ${test_name}")
#message(STATUS "test_tag : ${test_tag}")
option(${test_tag} "Build mpp ${module} unit test" ON)
option(${test_tag} "Build mpp ${module} unit test" ${BUILD_TEST})
if(${test_tag})
add_executable(${test_name} ${test_name}.c mpp_event_trigger.c mpp_parse_cfg.c)
target_link_libraries(${test_name} ${MPP_SHARED} utils)
@@ -54,7 +54,7 @@ macro(add_legacy_test module)
#message(STATUS "test_name : ${test_name}")
#message(STATUS "test_tag : ${test_tag}")
option(${test_tag} "Build legacy ${module} unit test" ON)
option(${test_tag} "Build legacy ${module} unit test" ${BUILD_TEST})
if(${test_tag})
add_executable(${test_name} ${test_name}.c)
if(ASAN_CHECK)