<commit_before>file (GLOB TEST_SUITE_FILES "*.hpp" "*.cpp")

if (USE_BOOST_DYNAMIC_LIBRARIES)
   add_definitions(-DBOOST_TEST_DYN_LINK)
endif (USE_BOOST_DYNAMIC_LIBRARIES)

find_package (Boost COMPONENTS unit_test_framework REQUIRED)
set (TEST quantlibext-test-suite)
add_executable (${TEST} ${TEST_SUITE_FILES})

message(STATUS " - Starting Link: ${QL_EXT_OUTPUT_NAME}")
message(STATUS " - Starting Link: ${QL_OUTPUT_NAME}")

target_link_libraries (${TEST} ${QL_LINK_LIBRARY}) 
target_link_libraries (${TEST} ql_ext_library)
target_link_libraries (${TEST} ${Boost_LIBRARIES})

set_property(TARGET ${TEST} PROPERTY PROJECT_LABEL "testsuite")

install(TARGETS ${TEST}
        RUNTIME DESTINATION bin
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
        )

enable_testing ()
add_test (${TEST} ${TEST})<commit_msg>fix build<commit_after>get_quantlib_library_name(QL_OUTPUT_NAME)
file(GLOB QL_EXT_TEST_SUITE_FILES "*.hpp" "*.cpp")
list(FILTER QL_EXT_TEST_SUITE_FILES EXCLUDE REGEX "main.cpp")

if (USE_BOOST_DYNAMIC_LIBRARIES)
   add_definitions(-DBOOST_TEST_DYN_LINK)
endif (USE_BOOST_DYNAMIC_LIBRARIES)

add_library(ql_ext_unit_test_main STATIC main.cpp)
target_include_directories(ql_ext_unit_test_main PRIVATE
        ${CMAKE_BINARY_DIR}
        ${CMAKE_SOURCE_DIR}
        ${Boost_INCLUDE_DIRS})

add_executable(ql_ext_test_suite ${QL_EXT_TEST_SUITE_FILES})
set_target_properties(ql_ext_test_suite PROPERTIES OUTPUT_NAME "quantlibext-test-suite")
if (NOT Boost_USE_STATIC_LIBS)
    target_compile_definitions(ql_ext_unit_test_main PRIVATE BOOST_TEST_DYN_LINK)
    target_compile_definitions(ql_ext_test_suite PRIVATE BOOST_ALL_DYN_LINK BOOST_TEST_DYN_LINK)
endif()
message(STATUS " - Starting Link: ql_ext_library")
message(STATUS " - Starting Link: ${QL_OUTPUT_NAME}")

target_link_libraries(ql_ext_test_suite PRIVATE
        ${QL_OUTPUT_NAME}
        ql_ext_library
        ql_ext_unit_test_main
        Boost::unit_test_framework)


install(TARGETS ql_ext_test_suite
        RUNTIME DESTINATION bin
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
        )

add_test(NAME test_suite COMMAND ql_ext_test_suite --log_level=message)
{'fraction_non_alphanumeric': 0.08163265306122448, 'fraction_numerical': 0.0, 'mean_word_length': 6.670068027210885, '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': '656431', 'n_tokens_mistral': 873, 'n_tokens_neox': 812, 'n_words': 132}