1# vim: syntax=cmake 2# ---------------------------------------------------------------------------- 3# OSAL built-in unit test case 4# ---------------------------------------------------------------------------- 5# macro for adding osal sub-module unit test 6macro(add_mpp_osal_test module) 7 set(test_name ${module}_test) 8 string(TOUPPER ${test_name} test_tag) 9 #message(STATUS "moduule : ${module}") 10 #message(STATUS "test_name : ${test_name}") 11 #message(STATUS "test_tag : ${test_tag}") 12 13 option(${test_tag} "Build osal ${module} unit test" ${BUILD_TEST}) 14 if(${test_tag}) 15 add_executable(${test_name} ${test_name}.c) 16 target_link_libraries(${test_name} ${MPP_SHARED}) 17 set_target_properties(${test_name} PROPERTIES FOLDER "osal/test") 18 add_test(NAME ${test_name} COMMAND ${test_name}) 19 endif() 20endmacro() 21 22# log system unit test 23add_mpp_osal_test(mpp_log) 24 25# env system unit test 26add_mpp_osal_test(mpp_env) 27 28# dmabuf system unit test 29add_mpp_osal_test(mpp_dmabuf) 30 31# malloc system unit test 32add_mpp_osal_test(mpp_mem) 33 34# mpp_mem_pool unit test 35add_mpp_osal_test(mpp_mem_pool) 36 37# time system unit test 38add_mpp_osal_test(mpp_time) 39 40# trace system unit test 41add_mpp_osal_test(mpp_trace) 42 43# hardware platform feature detection unit test 44add_mpp_osal_test(mpp_platform) 45 46# software runtime feature detection unit test 47add_mpp_osal_test(mpp_runtime) 48 49# thread implement unit test 50add_mpp_osal_test(mpp_thread) 51 52# eventfd implement unit test 53add_mpp_osal_test(mpp_eventfd) 54