summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/lib/cfl/tests/CMakeLists.txt
blob: 0fac328ca7228f1f301aa4d7fd0d5af998db7630 (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
include_directories(lib/acutest)

set(UNIT_TESTS_FILES
  kv.c
  sds.c
  hash.c
  list.c
  variant.c
  )

configure_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/cfl_tests_internal.h.in"
  "${CMAKE_CURRENT_SOURCE_DIR}/cfl_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 cfl-test-${source_file_we})
  add_executable(
    ${source_file_we}
    ${source_file}
    )
  target_link_libraries(${source_file_we} cfl-static)

  if (CFL_SANITIZE_ADDRESS)
    add_sanitizers(${source_file_we})
  endif()

  add_test(${source_file_we} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${source_file_we})
endforeach()