<commit_before>cmake_minimum_required (VERSION 2.6)
project (ajx)

set(CMAKE_CXX_COMPILER "g++")
enable_testing()

set(CMAKE_MACOSX_RPATH 1)

set(GCC_COVERAGE_COMPILE_FLAGS "")#"-std=c++11 -stdlib=libc++")
set(GCC_COVERAGE_LINK_FLAGS    "")

include_directories(include)

find_package(Boost COMPONENTS unit_test_framework REQUIRED)
include_directories (${Boost_INCLUDE_DIRS})

file(GLOB TEST_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/test/*.cpp)
message(STATUS "Test files: ${TEST_FILES}")

set (ajx_VERSION_MAJOR 0)
set (ajx_VERSION_MINOR 1)

set(CMAKE_CXX_FLAGS        "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")

file(GLOB SOURCES "src/lib/*.cpp")
ADD_LIBRARY( ${PROJECT_NAME} SHARED
       ${SOURCES}
       )

#add_executable(prog src/test/main.cpp)
#target_link_libraries(prog ${PROJECT_NAME})

foreach(test_src_file ${TEST_FILES})
        #Extract the filename without an extension (NAME_WE)
        get_filename_component(testName ${test_src_file} NAME_WE)

        #Add compile target
        add_executable(${testName} ${test_src_file})

        #link to Boost libraries AND your targets and dependencies
        target_link_libraries(${testName} ${Boost_LIBRARIES} ${PROJECT_NAME})

        #I like to move testing binaries into a binaries/tests directory
        set_target_properties(${testName} PROPERTIES 
            RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_SOURCE_DIR}/binaries/tests)

        #Finally add it to test execution - 
        #Notice the WORKING_DIRECTORY and COMMAND<commit_msg>Updated cmake config to put tests inside binaries dir<commit_after>cmake_minimum_required (VERSION 2.6)
project (ajx)

set(CMAKE_CXX_COMPILER "g++")
enable_testing()

set(CMAKE_MACOSX_RPATH 1)

set(GCC_COVERAGE_COMPILE_FLAGS "")#"-std=c++11 -stdlib=libc++")
set(GCC_COVERAGE_LINK_FLAGS    "")

include_directories(include)

find_package(Boost COMPONENTS unit_test_framework REQUIRED)
include_directories (${Boost_INCLUDE_DIRS})

set (ajx_VERSION_MAJOR 0)
set (ajx_VERSION_MINOR 1)

set(CMAKE_CXX_FLAGS        "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")

file(GLOB TEST_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/test/*.cpp)

file(GLOB SOURCES "src/lib/*.cpp")
ADD_LIBRARY( ${PROJECT_NAME} SHARED
       ${SOURCES}
       )

file(GLOB EXAMPLE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/examples/*.cpp)

#add_executable(prog src/te)
#target_link_libraries(prog ${PROJECT_NAME})

foreach(example_src_file ${EXAMPLE_FILES})
        get_filename_component(exampleName ${example_src_file} NAME_WE)

        add_executable(${exampleName} ${example_src_file})
        target_link_libraries(${exampleName} ${PROJECT_NAME} ${Boost_LIBRARIES})
        set_target_properties(${exampleName} PROPERTIES
            RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/binaries/examples)
endforeach(example_src_file)

foreach(test_src_file ${TEST_FILES})
        get_filename_component(testName ${test_src_file} NAME_WE)

        add_executable(${testName} ${test_src_file})
        target_link_libraries(${testName} ${Boost_LIBRARIES} ${PROJECT_NAME})
        set_target_properties(${testName} PROPERTIES 
            RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_SOURCE_DIR}/binaries/tests)

{'fraction_non_alphanumeric': 0.10654039656703167, 'fraction_numerical': 0.004143237644273453, 'mean_word_length': 5.773547094188377, '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': '5165575', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1183, 'n_words': 197}