2015-08-12 03:34:28 +00:00
|
|
|
# vim: syntax=cmake
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
# mpp built-in unit test case
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
# macro for adding mpp sub-module unit test
|
2022-02-08 11:47:34 +08:00
|
|
|
macro(add_mpp_test module ext)
|
2015-08-12 03:34:28 +00:00
|
|
|
set(test_name ${module}_test)
|
2022-02-08 11:47:34 +08:00
|
|
|
set(file_name ${test_name}.${ext})
|
2015-08-12 03:34:28 +00:00
|
|
|
string(TOUPPER ${test_name} test_tag)
|
|
|
|
|
#message(STATUS "moduule : ${module}")
|
|
|
|
|
#message(STATUS "test_name : ${test_name}")
|
|
|
|
|
#message(STATUS "test_tag : ${test_tag}")
|
|
|
|
|
|
2022-02-08 11:47:34 +08:00
|
|
|
option(${test_tag} "Build mpp ${module}.${ext} unit test" ${BUILD_TEST})
|
2015-08-12 03:34:28 +00:00
|
|
|
if(${test_tag})
|
2022-02-08 11:47:34 +08:00
|
|
|
add_executable(${test_name} ${file_name} mpp_event_trigger.c mpp_parse_cfg.c)
|
2017-12-01 11:00:26 +08:00
|
|
|
target_link_libraries(${test_name} ${MPP_SHARED} utils)
|
2008-01-24 21:36:21 +00:00
|
|
|
set_target_properties(${test_name} PROPERTIES FOLDER "test")
|
2017-12-15 16:55:17 +08:00
|
|
|
install(TARGETS ${test_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2016-04-01 09:49:23 +00:00
|
|
|
#add_test(NAME ${test_name} COMMAND ${test_name})
|
2015-08-12 03:34:28 +00:00
|
|
|
endif()
|
|
|
|
|
endmacro()
|
|
|
|
|
|
2018-05-03 20:14:37 +08:00
|
|
|
# mpp info test
|
2022-02-08 11:47:34 +08:00
|
|
|
add_mpp_test(mpp_info c)
|
2018-05-03 20:14:37 +08:00
|
|
|
|
2016-06-16 07:26:32 +00:00
|
|
|
# mpi decoder unit test
|
2022-02-08 11:47:34 +08:00
|
|
|
add_mpp_test(mpi_dec c)
|
2016-07-16 10:13:35 +00:00
|
|
|
|
2018-03-23 17:39:32 +08:00
|
|
|
# mpi decoder multi-thread input / output unit test
|
2022-02-08 11:47:34 +08:00
|
|
|
add_mpp_test(mpi_dec_mt c)
|
2018-03-23 17:39:32 +08:00
|
|
|
|
2021-04-20 19:18:45 +08:00
|
|
|
# mpi decoder no-thread input / output unit test
|
|
|
|
|
add_mpp_test(mpi_dec_nt c)
|
|
|
|
|
|
2016-07-16 10:13:35 +00:00
|
|
|
# mpi encoder unit test
|
2022-02-08 11:47:34 +08:00
|
|
|
add_mpp_test(mpi_enc c)
|
|
|
|
|
|
|
|
|
|
# mpi encoder multi-thread input / output unit test
|
2025-09-03 11:15:38 +08:00
|
|
|
add_mpp_test(mpi_enc_mt c)
|
2016-11-10 17:04:03 +08:00
|
|
|
|
2017-01-09 16:05:03 +08:00
|
|
|
# new mpi rc unit test
|
2022-02-08 11:47:34 +08:00
|
|
|
add_mpp_test(mpi_rc2 c)
|
2017-01-09 16:05:03 +08:00
|
|
|
|
2018-03-22 09:01:36 +08:00
|
|
|
# new dec multi unit test
|
2022-02-08 11:47:34 +08:00
|
|
|
add_mpp_test(mpi_dec_multi c)
|
2018-03-22 09:01:36 +08:00
|
|
|
|
2017-03-15 16:44:09 +08:00
|
|
|
macro(add_legacy_test module)
|
|
|
|
|
set(test_name ${module}_test)
|
|
|
|
|
string(TOUPPER ${test_name} test_tag)
|
|
|
|
|
#message(STATUS "moduule : ${module}")
|
|
|
|
|
#message(STATUS "test_name : ${test_name}")
|
|
|
|
|
#message(STATUS "test_tag : ${test_tag}")
|
|
|
|
|
|
2020-06-22 17:43:11 +08:00
|
|
|
option(${test_tag} "Build legacy ${module} unit test" ${BUILD_TEST})
|
2017-03-15 16:44:09 +08:00
|
|
|
if(${test_tag})
|
|
|
|
|
add_executable(${test_name} ${test_name}.c)
|
2020-06-11 14:55:33 +08:00
|
|
|
if(ASAN_CHECK)
|
|
|
|
|
target_link_libraries(${test_name} ${ASAN_LIB} pthread dl)
|
|
|
|
|
else(ASAN_CHECK)
|
|
|
|
|
target_link_libraries(${test_name} dl)
|
|
|
|
|
endif(ASAN_CHECK)
|
2017-03-15 16:44:09 +08:00
|
|
|
set_target_properties(${test_name} PROPERTIES FOLDER "test")
|
2017-12-15 16:55:17 +08:00
|
|
|
install(TARGETS ${test_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2017-03-15 16:44:09 +08:00
|
|
|
endif()
|
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
|
|
# legacy vpu_api unit test
|
|
|
|
|
add_legacy_test(vpu_api)
|