<commit_before>################################################################################
# tests/CMakeLists.txt
#
# CMake file for c7a testsuite
################################################################################

# macro for building test programs with correct libraries
macro(c7a_build TARGETNAME)

  add_executable(${TARGETNAME} ${ARGN})
  target_link_libraries(${TARGETNAME}
    c7a gtest gtest_main gmock ${ALL_LIBRARIES})

endmacro(c7a_build)

# macro for building test programs, without main() in c7a_tests.cpp
macro(build_plain PROGNAME)

  string(REPLACE "/" "_" TESTNAME "${PROGNAME}") # replace slashes

  c7a_build(${TESTNAME} ${PROGNAME}.cpp ${ARGN})

endmacro(build_plain)

# macro for building test programs, adding gtest runner in c7a_tests.cpp
macro(build_only PROGNAME)

  # append gtest runner program.
  build_plain(${PROGNAME} ${ARGN})

endmacro(build_only)

# macro for registering test programs: maybe prepend valgrind
macro(test_only TESTNAME)

  if(USE_VALGRIND)
    # prepend valgrind call
    add_test(
      NAME ${TESTNAME}
      COMMAND /usr/bin/valgrind ${C7A_VALGRIND_OPTS}
      --xml=yes --xml-file=${TESTNAME}.xml
      ./${TESTNAME} ${ARGN})
  else()
    add_test(
      NAME ${TESTNAME}
      COMMAND ${TESTNAME} ${ARGN})
  endif()

endmacro(test_only)

# macro for building and running test programs
macro(build_test PROGNAME)

  build_only(${PROGNAME})

  string(REPLACE "/" "_" TESTNAME "${PROGNAME}") # replace slashes
  test_only(${TESTNAME})

endmacro(build_test)

# macro for building and running a group of tests
macro(build_test_group TESTNAME)

  string(REPLACE "/" "_" TARGETNAME "${TESTNAME}") # replace slashes

  c7a_build(${TARGETNAME} ${ARGN})
  test_only(${TARGETNAME})

endmacro(build_test_group)

### list of tests in subdirectories

build_test(api/function_stack_test)
build_test(api/operations_test)
build_test(api/reduce_node_test)
build_test(api/wordcount_test)
build_test(api/sum_node_test)
build_test(data/manager_test)
build_test(data/buffer_chain_test)
build_test(data/binary_reader_test)
build_test(data/emitter_iterator_test)
build_test(data/manager_channels_test)
build_test(data/iterator_test)
#build_test(data/dia_allocate_test)
build_test(data/serializer_test)
build_plain(common/cmdline_parser_example)
build_test_group(common/tests
  common/cmdline_parser_test.cpp
  common/concurrent_bounded_queue_test.cpp
  common/concurrent_queue_test.cpp
  common/cyclic_barrier_test.cpp
  common/delegate_test.cpp
  common/function_traits_test.cpp
  common/future_queue_test.cpp
  common/future_test.cpp
  common/stats_counter_test.cpp
  common/stats_timer_test.cpp
  common/thread_pool_test.cpp
  )
#build_test(core/stage_builder_test)
#build_test(core/post_hash_table_test)
#build_test(core/pre_hash_table_probing_test)
build_test(core/pre_hash_table_test)
build_test(core/job_manager_test)
build_test(net/dispatcher_thread_test)<commit_msg>Again, disabling data/manager_channels_test, should be fixed while restructure File/Channels/etc.<commit_after>################################################################################
# tests/CMakeLists.txt
#
# CMake file for c7a testsuite
################################################################################

# macro for building test programs with correct libraries
macro(c7a_build TARGETNAME)

  add_executable(${TARGETNAME} ${ARGN})
  target_link_libraries(${TARGETNAME}
    c7a gtest gtest_main gmock ${ALL_LIBRARIES})

endmacro(c7a_build)

# macro for building test programs, without main() in c7a_tests.cpp
macro(build_plain PROGNAME)

  string(REPLACE "/" "_" TESTNAME "${PROGNAME}") # replace slashes

  c7a_build(${TESTNAME} ${PROGNAME}.cpp ${ARGN})

endmacro(build_plain)

# macro for building test programs, adding gtest runner in c7a_tests.cpp
macro(build_only PROGNAME)

  # append gtest runner program.
  build_plain(${PROGNAME} ${ARGN})

endmacro(build_only)

# macro for registering test programs: maybe prepend valgrind
macro(test_only TESTNAME)

  if(USE_VALGRIND)
    # prepend valgrind call
    add_test(
      NAME ${TESTNAME}
      COMMAND /usr/bin/valgrind ${C7A_VALGRIND_OPTS}
      --xml=yes --xml-file=${TESTNAME}.xml
      ./${TESTNAME} ${ARGN})
  else()
    add_test(
      NAME ${TESTNAME}
      COMMAND ${TESTNAME} ${ARGN})
  endif()

endmacro(test_only)

# macro for building and running test programs
macro(build_test PROGNAME)

  build_only(${PROGNAME})

  string(REPLACE "/" "_" TESTNAME "${PROGNAME}") # replace slashes
  test_only(${TESTNAME})

endmacro(build_test)

# macro for building and running a group of tests
macro(build_test_group TESTNAME)

  string(REPLACE "/" "_" TARGETNAME "${TESTNAME}") # replace slashes

  c7a_build(${TARGETNAME} ${ARGN})
  test_only(${TARGETNAME})

endmacro(build_test_group)

### list of tests in subdirectories

build_test(api/function_stack_test)
build_test(api/operations_test)
build_test(api/reduce_node_test)
build_test(api/wordcount_test)
build_test(api/sum_node_test)
build_test(data/manager_test)
build_test(data/buffer_chain_test)
build_test(data/binary_reader_test)
build_test(data/emitter_iterator_test)
#build_test(data/manager_channels_test)
build_test(data/iterator_test)
#build_test(data/dia_allocate_test)
build_test(data/serializer_test)
build_plain(common/cmdline_parser_example)
build_test_group(common/tests
  common/cmdline_parser_test.cpp
  common/concurrent_bounded_queue_test.cpp
  common/concurrent_queue_test.cpp
  common/cyclic_barrier_test.cpp
  common/delegate_test.cpp
  common/function_traits_test.cpp
  common/future_queue_test.cpp
  common/future_test.cpp
  common/stats_counter_test.cpp
  common/stats_timer_test.cpp
  common/thread_pool_test.cpp
  )
#build_test(core/stage_builder_test)
#build_test(core/post_hash_table_test)
#build_test(core/pre_hash_table_probing_test)
build_test(core/pre_hash_table_test)
build_test(core/job_manager_test)
build_test(net/dispatcher_thread_test)
{'fraction_non_alphanumeric': 0.15118826900387664, 'fraction_numerical': 0.0030338783077700996, 'mean_word_length': 6.559235668789809, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2185131', 'n_tokens_mistral': 2064, 'n_tokens_neox': 1988, 'n_words': 351}