summaryrefslogtreecommitdiffstats
path: root/fluent-bit/tests/internal/fuzzers/CMakeLists.txt
blob: e76be548a20ff150c5a2993d140de502442281a6 (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
58
59
60
set(UNIT_TESTS_FILES
  aws_util_fuzzer.c
  aws_credentials_fuzzer.c
  base64_fuzzer.c
  engine_fuzzer.c
  cmetrics_decode_fuzz.c
  config_fuzzer.c
  config_random_fuzzer.c
  ctrace_fuzzer.c
  input_fuzzer.c
  signv4_fuzzer.c
  flb_json_fuzzer.c
  flb_mp_fuzzer.c
  filter_stdout_fuzzer.c
  fstore_fuzzer.c
  parser_fuzzer.c
  parse_json_fuzzer.c
  parse_logfmt_fuzzer.c
  parse_ltsv_fuzzer.c
  msgpack_parse_fuzzer.c
  msgpack_to_gelf_fuzzer.c
  multiline_fuzzer.c
  pack_json_state_fuzzer.c
  http_fuzzer.c
  strp_fuzzer.c
  utils_fuzzer.c
  config_map_fuzzer.c
  record_ac_fuzzer.c
  config_yaml_fuzzer.c
  )

# 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 flb-it-fuzz-${source_file_we})

  add_executable(
    ${source_file_we}
    ${source_file} local_test.c
    )

  if(FLB_JEMALLOC)
    target_link_libraries(${source_file_we} libjemalloc ${CMAKE_THREAD_LIBS_INIT})
  else()
    target_link_libraries(${source_file_we} ${CMAKE_THREAD_LIBS_INIT})
  endif()

  if(FLB_STREAM_PROCESSOR)
    target_link_libraries(${source_file_we} flb-sp)
  endif()

  target_link_libraries(${source_file_we} fluent-bit-static)

  if (FLB_TESTS_OSSFUZZ)
   add_executable(${source_file_we}_OSSFUZZ ${source_file})
   target_link_libraries(${source_file_we}_OSSFUZZ ${CMAKE_THREAD_LIBS_INIT})
   set_target_properties(${source_file_we}_OSSFUZZ PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
   target_link_libraries(${source_file_we}_OSSFUZZ fluent-bit-static)
  endif()
endforeach()