<commit_before>project(packet-socket)
cmake_minimum_required(VERSION 2.8)

add_definitions( -Wall -Wextra -Werror)

function(add_module module_name)
  set(MOCKS)
  set(REDUCED_MODULES ${MODULES})
  list(REMOVE_ITEM REDUCED_MODULES ${module_name})
  foreach(MODULE ${REDUCED_MODULES})
    list(APPEND MOCKS ${MOCKS_DIR}/${MODULE}.cc)
  endforeach(MODULE)
  add_executable(test_${module_name} 
    ${SRC_DIR}/${module_name}.cc
    ${TESTS_DIR}/${module_name}.cc
    ${MOCKS})
  target_link_libraries(test_${module_name} CppUTest CppUTestExt)
  add_test(test_of_${module_name} test_${module_name} -v -c)
endfunction(add_module)

set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cc_tests)
set(MOCKS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cc_mocks)

set(MODULES
  
)

enable_testing()


set(TEST_TARGETS)
foreach(MODULE ${MODULES})
  list(APPEND TEST_TARGETS test_${MODULE})
endforeach(MODULE)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -VV
  DEPENDS ${TEST_TARGETS})<commit_msg>Add automatic module adding to test suite<commit_after>project(packet-socket)
cmake_minimum_required(VERSION 2.8)

add_definitions( -Wall -Wextra -Werror)

function(add_module module_name)
  set(MOCKS)
  set(REDUCED_MODULES ${MODULES})
  list(REMOVE_ITEM REDUCED_MODULES ${module_name})
  foreach(MODULE ${REDUCED_MODULES})
    list(APPEND MOCKS ${MOCKS_DIR}/${MODULE}.cc)
  endforeach(MODULE)
  add_executable(test_${module_name} 
    ${SRC_DIR}/${module_name}.cc
    ${TESTS_DIR}/${module_name}.cc
    ${MOCKS})
  target_link_libraries(test_${module_name} CppUTest CppUTestExt)
  add_test(test_of_${module_name} test_${module_name} -v -c)
endfunction(add_module)

set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cc_tests)
set(MOCKS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cc_mocks)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

set(MODULES
  
)

enable_testing()

#LOOP OVER MODULES
set(TEST_TARGETS)
foreach(MODULE ${MODULES})
  list(APPEND TEST_TARGETS test_${MODULE})
  add_module(${MODULE})
endforeach(MODULE)

add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -VV
  DEPENDS ${TEST_TARGETS})
{'fraction_non_alphanumeric': 0.12667591308368006, 'fraction_numerical': 0.0018492834026814608, 'mean_word_length': 7.587301587301587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2678401', 'n_tokens_mistral': 858, 'n_tokens_neox': 845, 'n_words': 118}