<commit_before>add_subdirectory(common)

set(TESTS
    TestBasicAuthMiddleware
    TestFilesystemHandler
    TestHandler
    TestIByteArray
    TestLocalAuthMiddleware
    TestLocalFile
    TestMiddleware
    TestParser
    TestProxyHandler
    TestQIODeviceCopier
    TestQObjectHandler
    TestRange
    TestServer
    TestSocket
)

qt5_add_resources(QRC resource.qrc)

foreach(TEST ${TESTS})
    add_executable(${TEST} ${TEST}.cpp ${QRC})
    set_target_properties(${TEST} PROPERTIES
        CXX_STANDARD 11
        CXX_STANDARD_REQUIRED ON
    )
    target_include_directories(${TEST} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
    target_link_libraries(${TEST} Qt5::Test qhttpengine common)
    add_test(NAME ${TEST}
        COMMAND ${TEST}
    )
endforeach()

# On Windows, the library's DLL must exist in the same directory as the test
# executables which link against it - create a custom command to copy it
if(WIN32 AND NOT BUILD_STATIC)
    add_custom_target(QHttpEngine-copy ALL
        "${CMAKE_COMMAND}" -E copy_if_different \"$<TARGET_FILE:QHttpEngine>\" \"${CMAKE_CURRENT_BINARY_DIR}\"
        DEPENDS QHttpEngine
    )
endif()
<commit_msg>Fix target name when building on Windows.<commit_after>add_subdirectory(common)

set(TESTS
    TestBasicAuthMiddleware
    TestFilesystemHandler
    TestHandler
    TestIByteArray
    TestLocalAuthMiddleware
    TestLocalFile
    TestMiddleware
    TestParser
    TestProxyHandler
    TestQIODeviceCopier
    TestQObjectHandler
    TestRange
    TestServer
    TestSocket
)

qt5_add_resources(QRC resource.qrc)

foreach(TEST ${TESTS})
    add_executable(${TEST} ${TEST}.cpp ${QRC})
    set_target_properties(${TEST} PROPERTIES
        CXX_STANDARD 11
        CXX_STANDARD_REQUIRED ON
    )
    target_include_directories(${TEST} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
    target_link_libraries(${TEST} Qt5::Test qhttpengine common)
    add_test(NAME ${TEST}
        COMMAND ${TEST}
    )
endforeach()

# On Windows, the library's DLL must exist in the same directory as the test
# executables which link against it - create a custom command to copy it
if(WIN32 AND NOT BUILD_STATIC)
    add_custom_target(qhttpengine-copy ALL
        "${CMAKE_COMMAND}" -E copy_if_different \"$<TARGET_FILE:qhttpengine>\" \"${CMAKE_CURRENT_BINARY_DIR}\"
        DEPENDS qhttpengine
    )
endif()

{'fraction_non_alphanumeric': 0.07946735395189003, 'fraction_numerical': 0.005154639175257732, 'mean_word_length': 3.913502109704641, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4186752', 'n_tokens_mistral': 759, 'n_tokens_neox': 736, 'n_words': 168}