<commit_before># We have some multithreaded tests, so let's activate threading support.
include(YACMAThreadingSetup)
include(YACMACompilerLinkerSettings)

list(APPEND MPPP_CXX_FLAGS_DEBUG ${YACMA_THREADING_CXX_FLAGS})
list(APPEND MPPP_CXX_FLAGS_RELEASE ${YACMA_THREADING_CXX_FLAGS})

function(ADD_MPPP_TESTCASE arg1)
  add_executable(${arg1} ${arg1}.cpp)
  target_link_libraries(${arg1} mp++ Threads::Threads)
  target_compile_options(${arg1} PRIVATE "$<$<CONFIG:DEBUG>:${MPPP_CXX_FLAGS_DEBUG}>" "$<$<CONFIG:RELEASE>:${MPPP_CXX_FLAGS_RELEASE}>")
  # NOTE: for clang-cl, cmake tries to set -std=c++11 here, which makes
  # it error out. Disable it as MSVC 2015 is implicitly C++14 anyway.
  if(NOT (YACMA_COMPILER_IS_MSVC AND YACMA_COMPILER_IS_CLANGXX))
    # Let's setup the target C++ standard, but only if the user did not provide it manually.
    if(NOT CMAKE_CXX_STANDARD)
      if(MPPP_COMPILER_SUPPORTS_CONCEPTS)
        # NOTE: the idea here is that we want to use C++14 if the compilers supports
        # concepts (as variable concepts are essentially template variables).
        set_property(TARGET ${arg1} PROPERTY CXX_STANDARD 14)
      else()
        set_property(TARGET ${arg1} PROPERTY CXX_STANDARD 11)
      endif()
    endif()
    set_property(TARGET ${arg1} PROPERTY CXX_STANDARD_REQUIRED YES)
    set_property(TARGET ${arg1} PROPERTY CXX_EXTENSIONS NO)
  endif()
  add_test(${arg1} ${arg1})
endfunction()

ADD_MPPP_TESTCASE(concepts)
ADD_MPPP_TESTCASE(integer_abs)
ADD_MPPP_TESTCASE(integer_addsub_ui)
ADD_MPPP_TESTCASE(integer_arith)
ADD_MPPP_TESTCASE(integer_arith_ops)
if(NOT MINGW)
    # At the moment this test results in a linking error in conjunction
    # with catch. Needs to be investigated.
    ADD_MPPP_TESTCASE(integer_basic)
endif()
ADD_MPPP_TESTCASE(integer_bin)
ADD_MPPP_TESTCASE(integer_divexact)
ADD_MPPP_TESTCASE(integer_even_odd)
ADD_MPPP_TESTCASE(integer_fac)
ADD_MPPP_TESTCASE(integer_gcd)
ADD_MPPP_TESTCASE(integer_get_mpz_t)
ADD_MPPP_TESTCASE(integer_hash)
ADD_MPPP_TESTCASE(integer_is_zero_one)
ADD_MPPP_TESTCASE(integer_neg)
ADD_MPPP_TESTCASE(integer_nextprime)
ADD_MPPP_TESTCASE(integer_pow)
ADD_MPPP_TESTCASE(integer_probab_prime_p)
ADD_MPPP_TESTCASE(integer_rel)
ADD_MPPP_TESTCASE(integer_set_zero_one)
ADD_MPPP_TESTCASE(integer_sqrt)
ADD_MPPP_TESTCASE(integer_view)

ADD_MPPP_TESTCASE(rational_abs)
ADD_MPPP_TESTCASE(rational_arith)
ADD_MPPP_TESTCASE(rational_arith_ops)
ADD_MPPP_TESTCASE(rational_basic)
ADD_MPPP_TESTCASE(rational_hash)
ADD_MPPP_TESTCASE(rational_inv)
ADD_MPPP_TESTCASE(rational_is_zero_one)
ADD_MPPP_TESTCASE(rational_neg)
ADD_MPPP_TESTCASE(rational_pow)
ADD_MPPP_TESTCASE(rational_rel)

ADD_MPPP_TESTCASE(utils)

if(MPPP_WITH_QUADMATH)
  ADD_MPPP_TESTCASE(real128_arith)
  ADD_MPPP_TESTCASE(real128_basic)
  ADD_MPPP_TESTCASE(real128_comparisons)
  ADD_MPPP_TESTCASE(real128_constants)
  ADD_MPPP_TESTCASE(real128_ieee)
  ADD_MPPP_TESTCASE(real128_io)
  ADD_MPPP_TESTCASE(real128_logexp)
  ADD_MPPP_TESTCASE(real128_naninffinite)
  ADD_MPPP_TESTCASE(real128_operators)
  ADD_MPPP_TESTCASE(real128_pow)
  ADD_MPPP_TESTCASE(real128_roots)
  ADD_MPPP_TESTCASE(real128_signbit)
  ADD_MPPP_TESTCASE(real128_trig)
endif()<commit_msg>MinGW workaround.<commit_after># We have some multithreaded tests, so let's activate threading support.
include(YACMAThreadingSetup)
include(YACMACompilerLinkerSettings)

list(APPEND MPPP_CXX_FLAGS_DEBUG ${YACMA_THREADING_CXX_FLAGS})
list(APPEND MPPP_CXX_FLAGS_RELEASE ${YACMA_THREADING_CXX_FLAGS})

function(ADD_MPPP_TESTCASE arg1)
  add_executable(${arg1} ${arg1}.cpp)
  target_link_libraries(${arg1} mp++ Threads::Threads)
  target_compile_options(${arg1} PRIVATE "$<$<CONFIG:DEBUG>:${MPPP_CXX_FLAGS_DEBUG}>" "$<$<CONFIG:RELEASE>:${MPPP_CXX_FLAGS_RELEASE}>")
  # NOTE: for clang-cl, cmake tries to set -std=c++11 here, which makes
  # it error out. Disable it as MSVC 2015 is implicitly C++14 anyway.
  if(NOT (YACMA_COMPILER_IS_MSVC AND YACMA_COMPILER_IS_CLANGXX))
    # Let's setup the target C++ standard, but only if the user did not provide it manually.
    if(NOT CMAKE_CXX_STANDARD)
      if(MPPP_COMPILER_SUPPORTS_CONCEPTS)
        # NOTE: the idea here is that we want to use C++14 if the compilers supports
        # concepts (as variable concepts are essentially template variables).
        set_property(TARGET ${arg1} PROPERTY CXX_STANDARD 14)
      else()
        set_property(TARGET ${arg1} PROPERTY CXX_STANDARD 11)
      endif()
    endif()
    set_property(TARGET ${arg1} PROPERTY CXX_STANDARD_REQUIRED YES)
    set_property(TARGET ${arg1} PROPERTY CXX_EXTENSIONS NO)
  endif()
  add_test(${arg1} ${arg1})
endfunction()

ADD_MPPP_TESTCASE(concepts)
ADD_MPPP_TESTCASE(integer_abs)
ADD_MPPP_TESTCASE(integer_addsub_ui)
ADD_MPPP_TESTCASE(integer_arith)
ADD_MPPP_TESTCASE(integer_arith_ops)
if(NOT MINGW)
    # At the moment this test results in a linking error in conjunction
    # with catch. Needs to be investigated.
    # NOTE: this might be related to the binary size, we can try splitting
    # some tests up more.
    ADD_MPPP_TESTCASE(integer_basic)
endif()
ADD_MPPP_TESTCASE(integer_bin)
ADD_MPPP_TESTCASE(integer_divexact)
ADD_MPPP_TESTCASE(integer_even_odd)
ADD_MPPP_TESTCASE(integer_fac)
ADD_MPPP_TESTCASE(integer_gcd)
ADD_MPPP_TESTCASE(integer_get_mpz_t)
ADD_MPPP_TESTCASE(integer_hash)
ADD_MPPP_TESTCASE(integer_is_zero_one)
ADD_MPPP_TESTCASE(integer_neg)
ADD_MPPP_TESTCASE(integer_nextprime)
ADD_MPPP_TESTCASE(integer_pow)
ADD_MPPP_TESTCASE(integer_probab_prime_p)
ADD_MPPP_TESTCASE(integer_rel)
ADD_MPPP_TESTCASE(integer_set_zero_one)
ADD_MPPP_TESTCASE(integer_sqrt)
ADD_MPPP_TESTCASE(integer_view)

ADD_MPPP_TESTCASE(rational_abs)
ADD_MPPP_TESTCASE(rational_arith)
ADD_MPPP_TESTCASE(rational_arith_ops)
if(NOT MINGW)
    # NOTE: same as above.
    ADD_MPPP_TESTCASE(rational_basic)
endif()
ADD_MPPP_TESTCASE(rational_hash)
ADD_MPPP_TESTCASE(rational_inv)
ADD_MPPP_TESTCASE(rational_is_zero_one)
ADD_MPPP_TESTCASE(rational_neg)
ADD_MPPP_TESTCASE(rational_pow)
ADD_MPPP_TESTCASE(rational_rel)

ADD_MPPP_TESTCASE(utils)

if(MPPP_WITH_QUADMATH)
  ADD_MPPP_TESTCASE(real128_arith)
  ADD_MPPP_TESTCASE(real128_basic)
  ADD_MPPP_TESTCASE(real128_comparisons)
  ADD_MPPP_TESTCASE(real128_constants)
  ADD_MPPP_TESTCASE(real128_ieee)
  ADD_MPPP_TESTCASE(real128_io)
  ADD_MPPP_TESTCASE(real128_logexp)
  ADD_MPPP_TESTCASE(real128_naninffinite)
  ADD_MPPP_TESTCASE(real128_operators)
  ADD_MPPP_TESTCASE(real128_pow)
  ADD_MPPP_TESTCASE(real128_roots)
  ADD_MPPP_TESTCASE(real128_signbit)
  ADD_MPPP_TESTCASE(real128_trig)
endif()
{'fraction_non_alphanumeric': 0.0782967032967033, 'fraction_numerical': 0.019536019536019536, 'mean_word_length': 7.976712328767123, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6570535', 'n_tokens_mistral': 2638, 'n_tokens_neox': 2503, 'n_words': 414}