32 lines
876 B
CMake
32 lines
876 B
CMake
find_package(GTest REQUIRED) # 查找GTest库
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/test) # 添加测试头文件目录
|
|
|
|
set(TEST_SRC_FILES
|
|
"test_gf256_header.cu"
|
|
"test_gf256_matrix.cu"
|
|
"test_gf256_elim.cu"
|
|
"test_gfp_mul.cu"
|
|
"test_gfp_elim.cu"
|
|
"test_gf2_elim.cu"
|
|
)
|
|
|
|
foreach(SRC ${TEST_SRC_FILES})
|
|
get_filename_component(SRC_NAME ${SRC} NAME_WE)
|
|
add_executable(${SRC_NAME} ${SRC})
|
|
target_link_libraries(${SRC_NAME} GTest::GTest GTest::Main)
|
|
gtest_discover_tests(${SRC_NAME})
|
|
endforeach()
|
|
|
|
set(TEST_M4RIE_SRC_FILES
|
|
"test_m4ri_interface.cu"
|
|
"test_m4rie_interface.cu"
|
|
)
|
|
|
|
foreach(SRC ${TEST_M4RIE_SRC_FILES})
|
|
get_filename_component(SRC_NAME ${SRC} NAME_WE)
|
|
add_executable(${SRC_NAME} ${SRC})
|
|
target_link_libraries(${SRC_NAME} GTest::GTest GTest::Main m4ri m4rie)
|
|
gtest_discover_tests(${SRC_NAME})
|
|
endforeach()
|