<commit_before>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROJECT blackhole-tests)

# The next line enforces google testing framework to use own tuple implementation.
ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/foreign/gmock ${CMAKE_BINARY_DIR}/gmock)

ENABLE_TESTING()

SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")

IF(ENABLE_ELASTICSEARCH)
    ADD_DEFINITIONS(-DURDL_HEADER_ONLY=1)
    ADD_DEFINITIONS(-DURDL_DISABLE_SSL=1)
ENDIF()

ADD_DEFINITIONS(-DBLACKHOLE_HEADER_ONLY=1)

IF(ENABLE_ELASTICSEARCH_DEBUG)
    ADD_DEFINITIONS(-DENABLE_ELASTICSEARCH_DEBUG=1)
ENDIF()

file(GLOB_RECURSE BLACKHOLE_HEADERS . ../blackhole/*.[hi]pp)
file(GLOB_RECURSE BLACKHOLE_TESTING_HEADERS . *.hpp)

SET(HEADERS
    ${BLACKHOLE_HEADERS}
    ${BLACKHOLE_TESTING_HEADERS}
)

SET(BASE_SOURCES
    main
    datetime/test_DayOfYear
    datetime/test_DayOfMonth
    datetime/test_DayOfWeek
    datetime/test_Month
    datetime/test_Other
    datetime/test_Time
    datetime/test_Year
    datetime/test_Week
    test_AttachableStream
    test_Attribute
    test_Config
    test_ConfigJsonInitialization
    test_ExceptionTrap
    test_FactoryInitialization
    test_FileRotation
    test_FileRotationNaming
    test_FileBackend
    test_FileRotationSizeWatcher
    test_FileRotationDateTimeWatcher
    test_FileSink
    test_Filter
    test_Functional
    test_JsonFormatter
    test_Keyword
    test_Logger
    test_LoggerSynchronized
    test_Macro
    test_Manual
    test_MsgpackFormatter
    test_NullSink
    test_ScopedAttributes
    test_StreamSink
    test_StringFormatter
    test_StringPatternParser
    test_SyslogSink
    test_Traits
    test_UdpSink
    test_Utils
    test_VerboseLogger
    utils/test_GenericStringFormatter
    Trace
    Wrapper
    Dynamic
)

IF(ENABLE_ELASTICSEARCH)
    SET(ES_SOURCES
        extra/ElasticsearchSink
        extra/elasticsearch/Factory
        extra/elasticsearch/Transport
        extra/elasticsearch/Requests
        extra/elasticsearch/Utils
        extra/Resolver
        extra/UrlFetch
    )
ENDIF()

SET(SOURCES
    ${BASE_SOURCES}
    ${ES_SOURCES}
)

SET(Boost_USE_MULTITHREADED ON)

SET(BOOST_COMPONENTS
    system
    filesystem
    thread
    date_time
)

PROJECT(${PROJECT})

INCLUDE_DIRECTORIES(
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_SOURCE_DIR}/foreign/rapidjson/include
    SYSTEM ${CMAKE_SOURCE_DIR}/foreign/gmock/include
    SYSTEM ${CMAKE_SOURCE_DIR}/foreign/gtest/include
)

LINK_DIRECTORIES(
    ${CMAKE_BINARY_DIR}/gmock/gtest
    ${CMAKE_BINARY_DIR}/gmock
)

FIND_PACKAGE(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED)

ADD_EXECUTABLE(${PROJECT} ${HEADERS} ${SOURCES})

TARGET_LINK_LIBRARIES(${PROJECT}
    ${CMAKE_THREAD_LIBS_INIT}
    ${Boost_LIBRARIES}
    gmock
    gtest
    msgpack
)

IF(ENABLE_ELASTICSEARCH)
    INCLUDE_DIRECTORIES(
        SYSTEM ${CMAKE_SOURCE_DIR}/foreign/urdl/include
    )
ENDIF()

ADD_TEST(NAME blackhole-tests COMMAND blackhole-tests)

ADD_DEFINITIONS(-std=c++0x)

<commit_msg>[Aux] Tiny fix.<commit_after>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROJECT blackhole-tests)

# The next line enforces google testing framework to use own tuple implementation.
ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/foreign/gmock ${CMAKE_BINARY_DIR}/gmock)

ENABLE_TESTING()

SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")

IF(ENABLE_ELASTICSEARCH)
    ADD_DEFINITIONS(-DURDL_HEADER_ONLY=1)
    ADD_DEFINITIONS(-DURDL_DISABLE_SSL=1)
ENDIF()

ADD_DEFINITIONS(-DBLACKHOLE_HEADER_ONLY)

IF(ENABLE_ELASTICSEARCH_DEBUG)
    ADD_DEFINITIONS(-DENABLE_ELASTICSEARCH_DEBUG=1)
ENDIF()

file(GLOB_RECURSE BLACKHOLE_HEADERS . ../blackhole/*.[hi]pp)
file(GLOB_RECURSE BLACKHOLE_TESTING_HEADERS . *.hpp)

SET(HEADERS
    ${BLACKHOLE_HEADERS}
    ${BLACKHOLE_TESTING_HEADERS}
)

SET(BASE_SOURCES
    main
    datetime/test_DayOfYear
    datetime/test_DayOfMonth
    datetime/test_DayOfWeek
    datetime/test_Month
    datetime/test_Other
    datetime/test_Time
    datetime/test_Year
    datetime/test_Week
    test_AttachableStream
    test_Attribute
    test_Config
    test_ConfigJsonInitialization
    test_ExceptionTrap
    test_FactoryInitialization
    test_FileRotation
    test_FileRotationNaming
    test_FileBackend
    test_FileRotationSizeWatcher
    test_FileRotationDateTimeWatcher
    test_FileSink
    test_Filter
    test_Functional
    test_JsonFormatter
    test_Keyword
    test_Logger
    test_LoggerSynchronized
    test_Macro
    test_Manual
    test_MsgpackFormatter
    test_NullSink
    test_ScopedAttributes
    test_StreamSink
    test_StringFormatter
    test_StringPatternParser
    test_SyslogSink
    test_Traits
    test_UdpSink
    test_Utils
    test_VerboseLogger
    utils/test_GenericStringFormatter
    Trace
    Wrapper
    Dynamic
)

IF(ENABLE_ELASTICSEARCH)
    SET(ES_SOURCES
        extra/ElasticsearchSink
        extra/elasticsearch/Factory
        extra/elasticsearch/Transport
        extra/elasticsearch/Requests
        extra/elasticsearch/Utils
        extra/Resolver
        extra/UrlFetch
    )
ENDIF()

SET(SOURCES
    ${BASE_SOURCES}
    ${ES_SOURCES}
)

SET(Boost_USE_MULTITHREADED ON)

SET(BOOST_COMPONENTS
    system
    filesystem
    thread
    date_time
)

PROJECT(${PROJECT})

INCLUDE_DIRECTORIES(
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_SOURCE_DIR}/foreign/rapidjson/include
    SYSTEM ${CMAKE_SOURCE_DIR}/foreign/gmock/include
    SYSTEM ${CMAKE_SOURCE_DIR}/foreign/gtest/include
)

LINK_DIRECTORIES(
    ${CMAKE_BINARY_DIR}/gmock/gtest
    ${CMAKE_BINARY_DIR}/gmock
)

FIND_PACKAGE(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED)

ADD_EXECUTABLE(${PROJECT} ${HEADERS} ${SOURCES})

TARGET_LINK_LIBRARIES(${PROJECT}
    ${CMAKE_THREAD_LIBS_INIT}
    ${Boost_LIBRARIES}
    gmock
    gtest
    msgpack
)

IF(ENABLE_ELASTICSEARCH)
    INCLUDE_DIRECTORIES(
        SYSTEM ${CMAKE_SOURCE_DIR}/foreign/urdl/include
    )
ENDIF()

ADD_TEST(NAME blackhole-tests COMMAND blackhole-tests)

ADD_DEFINITIONS(-std=c++0x)


{'fraction_non_alphanumeric': 0.07210750573582432, 'fraction_numerical': 0.0027859718125204853, 'mean_word_length': 4.216239316239316, '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': '7626169', 'n_tokens_mistral': 2287, 'n_tokens_neox': 2179, 'n_words': 288}