mirror of
https://github.com/intel/isa-l.git
synced 2025-10-29 20:59:43 +01:00
cmake: add functional tests
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
@@ -38,6 +38,13 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "
|
||||
enable_language(ASM_NASM)
|
||||
endif()
|
||||
|
||||
# Enable testing
|
||||
option(BUILD_TESTS "Build the testing tree" ON)
|
||||
if(BUILD_TESTS)
|
||||
enable_testing()
|
||||
include(CTest)
|
||||
endif()
|
||||
|
||||
# Set default build type
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
@@ -118,3 +118,22 @@ set(CRC_HEADERS
|
||||
|
||||
# Add to main extern headers list
|
||||
list(APPEND EXTERN_HEADERS ${CRC_HEADERS})
|
||||
|
||||
# Add test applications for crc module
|
||||
if(BUILD_TESTS)
|
||||
# Check tests (unit tests that are run by CTest)
|
||||
set(CRC_CHECK_TESTS
|
||||
crc16_t10dif_test
|
||||
crc16_t10dif_copy_test
|
||||
crc64_funcs_test
|
||||
crc32_funcs_test
|
||||
)
|
||||
|
||||
# Create check test executables
|
||||
foreach(test ${CRC_CHECK_TESTS})
|
||||
add_executable(${test} crc/${test}.c)
|
||||
target_link_libraries(${test} PRIVATE isal)
|
||||
target_include_directories(${test} PRIVATE include)
|
||||
add_test(NAME ${test} COMMAND ${test})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -191,3 +191,50 @@ set(ERASURE_CODE_HEADERS
|
||||
|
||||
# Add to main extern headers list
|
||||
list(APPEND EXTERN_HEADERS ${ERASURE_CODE_HEADERS})
|
||||
|
||||
# Add test applications for erasure_code module
|
||||
if(BUILD_TESTS)
|
||||
# Check tests (unit tests that are run by CTest)
|
||||
set(ERASURE_CODE_CHECK_TESTS
|
||||
gf_vect_mul_test
|
||||
erasure_code_test
|
||||
gf_inverse_test
|
||||
erasure_code_update_test
|
||||
)
|
||||
|
||||
# Unit tests (additional unit tests)
|
||||
set(ERASURE_CODE_UNIT_TESTS
|
||||
gf_vect_mul_base_test
|
||||
gf_vect_dot_prod_base_test
|
||||
gf_vect_dot_prod_test
|
||||
gf_vect_mad_test
|
||||
erasure_code_base_test
|
||||
)
|
||||
|
||||
# Other tests
|
||||
set(ERASURE_CODE_OTHER_TESTS
|
||||
gen_rs_matrix_limits
|
||||
)
|
||||
|
||||
# Create check test executables
|
||||
foreach(test ${ERASURE_CODE_CHECK_TESTS})
|
||||
add_executable(${test} erasure_code/${test}.c)
|
||||
target_link_libraries(${test} PRIVATE isal)
|
||||
target_include_directories(${test} PRIVATE include)
|
||||
add_test(NAME ${test} COMMAND ${test})
|
||||
endforeach()
|
||||
|
||||
# Create unit test executables
|
||||
foreach(test ${ERASURE_CODE_UNIT_TESTS})
|
||||
add_executable(${test} erasure_code/${test}.c)
|
||||
target_link_libraries(${test} PRIVATE isal)
|
||||
target_include_directories(${test} PRIVATE include)
|
||||
endforeach()
|
||||
|
||||
# Create other test executables
|
||||
foreach(test ${ERASURE_CODE_OTHER_TESTS})
|
||||
add_executable(${test} erasure_code/${test}.c)
|
||||
target_link_libraries(${test} PRIVATE isal)
|
||||
target_include_directories(${test} PRIVATE include)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -115,3 +115,21 @@ set(IGZIP_HEADERS
|
||||
|
||||
# Add to main extern headers list
|
||||
list(APPEND EXTERN_HEADERS ${IGZIP_HEADERS})
|
||||
|
||||
# Add test applications for igzip module
|
||||
if(BUILD_TESTS)
|
||||
# Check tests (unit tests that are run by CTest)
|
||||
set(IGZIP_CHECK_TESTS
|
||||
igzip_rand_test
|
||||
igzip_wrapper_hdr_test
|
||||
checksum32_funcs_test
|
||||
)
|
||||
|
||||
# Create check test executables
|
||||
foreach(test ${IGZIP_CHECK_TESTS})
|
||||
add_executable(${test} igzip/${test}.c)
|
||||
target_link_libraries(${test} PRIVATE isal)
|
||||
target_include_directories(${test} PRIVATE include igzip)
|
||||
add_test(NAME ${test} COMMAND ${test})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -76,3 +76,19 @@ set(MEM_HEADERS
|
||||
|
||||
# Add to main extern headers list
|
||||
list(APPEND EXTERN_HEADERS ${MEM_HEADERS})
|
||||
|
||||
# Add test applications for mem module
|
||||
if(BUILD_TESTS)
|
||||
# Check tests (unit tests that are run by CTest)
|
||||
set(MEM_CHECK_TESTS
|
||||
mem_zero_detect_test
|
||||
)
|
||||
|
||||
# Create check test executables
|
||||
foreach(test ${MEM_CHECK_TESTS})
|
||||
add_executable(${test} mem/${test}.c)
|
||||
target_link_libraries(${test} PRIVATE isal)
|
||||
target_include_directories(${test} PRIVATE include)
|
||||
add_test(NAME ${test} COMMAND ${test})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -89,3 +89,22 @@ set(RAID_HEADERS
|
||||
|
||||
# Add to main extern headers list
|
||||
list(APPEND EXTERN_HEADERS ${RAID_HEADERS})
|
||||
|
||||
# Add test applications for raid module
|
||||
if(BUILD_TESTS)
|
||||
# Check tests (unit tests that are run by CTest)
|
||||
set(RAID_CHECK_TESTS
|
||||
xor_gen_test
|
||||
pq_gen_test
|
||||
xor_check_test
|
||||
pq_check_test
|
||||
)
|
||||
|
||||
# Create check test executables
|
||||
foreach(test ${RAID_CHECK_TESTS})
|
||||
add_executable(${test} raid/${test}.c)
|
||||
target_link_libraries(${test} PRIVATE isal)
|
||||
target_include_directories(${test} PRIVATE include)
|
||||
add_test(NAME ${test} COMMAND ${test})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user