blob: 7cee7e6c936d815fb0c9b02c4cd3112f769c4409 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
include_directories(lib/acutest)
set(UNIT_TESTS_FILES
context.c
memfs.c
stream.c
)
if(CIO_BACKEND_FILESYSTEM)
set(UNIT_TESTS_FILES
${UNIT_TESTS_FILES}
fs.c
)
endif()
set(CIO_TESTS_DATA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cio_tests_internal.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/cio_tests_internal.h"
)
# Prepare list of unit tests
foreach(source_file ${UNIT_TESTS_FILES})
get_filename_component(source_file_we ${source_file} NAME_WE)
set(source_file_we cio-test-${source_file_we})
add_executable(
${source_file_we}
${source_file}
)
target_link_libraries(${source_file_we} chunkio-static)
if (CIO_SANITIZE_ADDRESS)
add_sanitizers(${source_file_we})
endif()
add_test(${source_file_we} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${source_file_we})
endforeach()
# Perf tests for dev purposes: note these tests are not registered, they need to
# be executed manually
set(UNIT_PERF_TESTS
fs_perf.c
fs_fragmentation.c
)
foreach(source_file ${UNIT_PERF_TESTS})
get_filename_component(source_file_we ${source_file} NAME_WE)
set(source_file_we cio-${source_file_we})
add_executable(
${source_file_we}
${source_file}
)
target_link_libraries(${source_file_we} chunkio-static)
if (CIO_SANITIZE_ADDRESS)
add_sanitizers(${source_file_we})
endif()
#add_test(${source_file_we} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${source_file_we})
endforeach()
|