<commit_before>add_project(aws-cpp-sdk-core-tests 
    "Tests for the AWS Core C++ Library"
    testing-resources 
    aws-cpp-sdk-core )

# Headers are included in the source so that they show up in Visual Studio.
# They are included elsewhere for consistency.
file(GLOB AWS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/*.cpp")
file(GLOB AWS_AUTH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/auth/*.cpp")
file(GLOB AWS_CONFIG_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/config/*.cpp")
file(GLOB AWS_CLIENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/client/*.cpp")
file(GLOB AWS_NET_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/net/*.cpp")
file(GLOB HTTP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/http/*.cpp")
file(GLOB UTILS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.cpp")
file(GLOB UTILS_CRYPTO_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/crypto/*.cpp")
file(GLOB UTILS_EVENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/event/*.cpp")
file(GLOB UTILS_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/json/*.cpp")
file(GLOB UTILS_STREAM_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/stream/*.cpp")
file(GLOB UTILS_LOGGING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/logging/*.cpp")
file(GLOB UTILS_RATE_LIMITER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/ratelimiter/*.cpp")
file(GLOB UTILS_XML_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/xml/*.cpp")
file(GLOB UTILS_THREADING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/threading/*.cpp")
file(GLOB UTILS_MEMORY_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/memory/*.cpp")
file(GLOB MONITORING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/monitoring/*.cpp")


file(GLOB AWS_CPP_SDK_CORE_TESTS_SRC
  "${CMAKE_CURRENT_SOURCE_DIR}/RunTests.cpp"
  "${CMAKE_CURRENT_SOURCE_DIR}/VersionTests.cpp"
  ${AWS_SRC}
  ${AWS_AUTH_SRC}
  ${AWS_CONFIG_SRC}
  ${MONITORING_SRC}
  ${AWS_CLIENT_SRC}
  ${AWS_NET_SRC}
  ${HTTP_SRC}
  ${UTILS_SRC}
  ${UTILS_CRYPTO_SRC}
  ${UTILS_EVENT_SRC}
  ${UTILS_JSON_SRC}
  ${UTILS_STREAM_SRC}
  ${UTILS_XML_SRC}
  ${UTILS_THREADING_SRC}
  ${UTILS_MEMORY_SRC}
  ${UTILS_LOGGING_SRC}
  ${UTILS_RATE_LIMITER_SRC}
)

if(PLATFORM_WINDOWS)
  if(MSVC)
    source_group("Source Files\\aws" FILES ${AWS_SRC})
    source_group("Source Files\\aws\\auth" FILES ${AWS_AUTH_SRC})
    source_group("Source Files\\aws\\config" FILES ${AWS_CONFIG_SRC})
    source_group("Source Files\\aws\\client" FILES ${AWS_CLIENT_SRC})
    source_group("Source Files\\aws\\net" FILES ${AWS_NET_SRC})
    source_group("Source Files\\http" FILES  ${HTTP_SRC})
    source_group("Source Files\\monitoring" FILES ${MONITORING_SRC})
    source_group("Source Files\\utils" FILES ${UTILS_SRC})
    source_group("Source Files\\utils\\crypto" FILES ${UTILS_CRYPTO_SRC})
    source_group("Source Files\\utils\\event" FILES ${UTILS_EVENT_SRC})
    source_group("Source Files\\utils\\json" FILES ${UTILS_JSON_SRC})
    source_group("Source Files\\utils\\stream" FILES ${UTILS_STREAM_SRC})
    source_group("Source Files\\utils\\xml" FILES ${UTILS_XML_SRC})
    source_group("Source Files\\utils\\logging" FILES ${UTILS_LOGGING_SRC})
    source_group("Source Files\\utils\\ratelimiter" FILES ${UTILS_RATE_LIMITER_SRC})
    source_group("Source Files\\utils\\memory" FILES ${UTILS_MEMORY_SRC})
    source_group("Source Files\\utils\\threading" FILES ${UTILS_THREADING_SRC})
  endif()
endif()

if(PLATFORM_CUSTOM)
    if(COMMAND add_custom_core_testing_definitions)
        add_custom_core_testing_definitions()
    endif()
endif()

if (CMAKE_CROSSCOMPILING)
    set(AUTORUN_UNIT_TESTS OFF)
endif()

if (AUTORUN_UNIT_TESTS)
    enable_testing()
endif()

if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS)
    add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
endif()

if(PLATFORM_ANDROID AND BUILD_SHARED_LIBS)
    add_library(${PROJECT_NAME} ${LIBTYPE} ${AWS_CPP_SDK_CORE_TESTS_SRC})
else()
    add_executable(${PROJECT_NAME} ${AWS_CPP_SDK_CORE_TESTS_SRC})
endif()

set_compiler_flags(${PROJECT_NAME})
set_compiler_warnings(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS})

add_custom_command(TARGET aws-cpp-sdk-core-tests PRE_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy_directory
                   ${CMAKE_CURRENT_SOURCE_DIR}/resources ${CMAKE_CURRENT_BINARY_DIR})

if (AUTORUN_UNIT_TESTS)
    ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} POST_BUILD COMMAND $<TARGET_FILE:${PROJECT_NAME}>)
endif()

if(NOT CMAKE_CROSSCOMPILING)
    SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
endif()<commit_msg>Randomize the unit tests on each run<commit_after>add_project(aws-cpp-sdk-core-tests 
    "Tests for the AWS Core C++ Library"
    testing-resources 
    aws-cpp-sdk-core )

# Headers are included in the source so that they show up in Visual Studio.
# They are included elsewhere for consistency.
file(GLOB AWS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/*.cpp")
file(GLOB AWS_AUTH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/auth/*.cpp")
file(GLOB AWS_CONFIG_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/config/*.cpp")
file(GLOB AWS_CLIENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/client/*.cpp")
file(GLOB AWS_NET_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/net/*.cpp")
file(GLOB HTTP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/http/*.cpp")
file(GLOB UTILS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.cpp")
file(GLOB UTILS_CRYPTO_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/crypto/*.cpp")
file(GLOB UTILS_EVENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/event/*.cpp")
file(GLOB UTILS_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/json/*.cpp")
file(GLOB UTILS_STREAM_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/stream/*.cpp")
file(GLOB UTILS_LOGGING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/logging/*.cpp")
file(GLOB UTILS_RATE_LIMITER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/ratelimiter/*.cpp")
file(GLOB UTILS_XML_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/xml/*.cpp")
file(GLOB UTILS_THREADING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/threading/*.cpp")
file(GLOB UTILS_MEMORY_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/memory/*.cpp")
file(GLOB MONITORING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/monitoring/*.cpp")


file(GLOB AWS_CPP_SDK_CORE_TESTS_SRC
  "${CMAKE_CURRENT_SOURCE_DIR}/RunTests.cpp"
  "${CMAKE_CURRENT_SOURCE_DIR}/VersionTests.cpp"
  ${AWS_SRC}
  ${AWS_AUTH_SRC}
  ${AWS_CONFIG_SRC}
  ${MONITORING_SRC}
  ${AWS_CLIENT_SRC}
  ${AWS_NET_SRC}
  ${HTTP_SRC}
  ${UTILS_SRC}
  ${UTILS_CRYPTO_SRC}
  ${UTILS_EVENT_SRC}
  ${UTILS_JSON_SRC}
  ${UTILS_STREAM_SRC}
  ${UTILS_XML_SRC}
  ${UTILS_THREADING_SRC}
  ${UTILS_MEMORY_SRC}
  ${UTILS_LOGGING_SRC}
  ${UTILS_RATE_LIMITER_SRC}
)

if(PLATFORM_WINDOWS)
  if(MSVC)
    source_group("Source Files\\aws" FILES ${AWS_SRC})
    source_group("Source Files\\aws\\auth" FILES ${AWS_AUTH_SRC})
    source_group("Source Files\\aws\\config" FILES ${AWS_CONFIG_SRC})
    source_group("Source Files\\aws\\client" FILES ${AWS_CLIENT_SRC})
    source_group("Source Files\\aws\\net" FILES ${AWS_NET_SRC})
    source_group("Source Files\\http" FILES  ${HTTP_SRC})
    source_group("Source Files\\monitoring" FILES ${MONITORING_SRC})
    source_group("Source Files\\utils" FILES ${UTILS_SRC})
    source_group("Source Files\\utils\\crypto" FILES ${UTILS_CRYPTO_SRC})
    source_group("Source Files\\utils\\event" FILES ${UTILS_EVENT_SRC})
    source_group("Source Files\\utils\\json" FILES ${UTILS_JSON_SRC})
    source_group("Source Files\\utils\\stream" FILES ${UTILS_STREAM_SRC})
    source_group("Source Files\\utils\\xml" FILES ${UTILS_XML_SRC})
    source_group("Source Files\\utils\\logging" FILES ${UTILS_LOGGING_SRC})
    source_group("Source Files\\utils\\ratelimiter" FILES ${UTILS_RATE_LIMITER_SRC})
    source_group("Source Files\\utils\\memory" FILES ${UTILS_MEMORY_SRC})
    source_group("Source Files\\utils\\threading" FILES ${UTILS_THREADING_SRC})
  endif()
endif()

if(PLATFORM_CUSTOM)
    if(COMMAND add_custom_core_testing_definitions)
        add_custom_core_testing_definitions()
    endif()
endif()

if (CMAKE_CROSSCOMPILING)
    set(AUTORUN_UNIT_TESTS OFF)
endif()

if (AUTORUN_UNIT_TESTS)
    enable_testing()
endif()

if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS)
    add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1)
endif()

if(PLATFORM_ANDROID AND BUILD_SHARED_LIBS)
    add_library(${PROJECT_NAME} ${LIBTYPE} ${AWS_CPP_SDK_CORE_TESTS_SRC})
else()
    add_executable(${PROJECT_NAME} ${AWS_CPP_SDK_CORE_TESTS_SRC})
endif()

set_compiler_flags(${PROJECT_NAME})
set_compiler_warnings(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS})

add_custom_command(TARGET aws-cpp-sdk-core-tests PRE_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy_directory
                   ${CMAKE_CURRENT_SOURCE_DIR}/resources ${CMAKE_CURRENT_BINARY_DIR})

if (AUTORUN_UNIT_TESTS)
    ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} POST_BUILD COMMAND $<TARGET_FILE:${PROJECT_NAME}>
        ARGS "--gtest_shuffle" "--gtest_repeat=3")
endif()

if(NOT CMAKE_CROSSCOMPILING)
    SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
endif()
{'fraction_non_alphanumeric': 0.1350740363965186, 'fraction_numerical': 0.00033909799932180403, 'mean_word_length': 6.216965742251223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '914487', 'n_tokens_mistral': 3460, 'n_tokens_neox': 3334, 'n_words': 474}