<commit_before>macro(pythonize_bool var)
  if (${var})
    set(${var} True)
  else()
    set(${var} False)
  endif()
endmacro()

include(FindPythonInterp)
if(PYTHONINTERP_FOUND)
  set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
  set(LIT_ARGS_DEFAULT "-sv")
  if (MSVC OR XCODE)
    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
  endif()
  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
      CACHE STRING "Default options for lit")
  set(LIT_ARGS "${LLVM_LIT_ARGS}")
  separate_arguments(LIT_ARGS)

  set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
  set(LIBCXX_SOURCE_DIR ${CMAKE_SOURCE_DIR})
  set(LIBCXX_BINARY_DIR ${CMAKE_BINARY_DIR})
  set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
  pythonize_bool(LIBCXX_ENABLE_SHARED)
  pythonize_bool(LIBCXX_HAS_STDCXX0X_FLAG)

  set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")

  configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
    ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
    @ONLY)

  add_custom_target(check-libcxx
    COMMAND ${PYTHON_EXECUTABLE}
            ${LIT_EXECUTABLE}
            ${LIT_ARGS}
            ${CMAKE_CURRENT_BINARY_DIR}
    DEPENDS
    COMMENT "Running libcxx tests")
else()
  message(WARNING "Could not find Python, no check target will be available!")
endif()<commit_msg>Make it possible to run the test suite when built as part of LLVM.<commit_after>macro(pythonize_bool var)
  if (${var})
    set(${var} True)
  else()
    set(${var} False)
  endif()
endmacro()

include(FindPythonInterp)
if(PYTHONINTERP_FOUND)
  if(LIBCXX_BUILT_STANDALONE)
    set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
  else()
    set(LIT_EXECUTABLE "${CMAKE_SOURCE_DIR}/utils/lit/lit.py")
  endif()

  set(LIT_ARGS_DEFAULT "-sv")
  if (MSVC OR XCODE)
    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
  endif()
  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
      CACHE STRING "Default options for lit")
  set(LIT_ARGS "${LLVM_LIT_ARGS}")
  separate_arguments(LIT_ARGS)

  set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
  set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
  set(LIBCXX_BINARY_DIR ${CMAKE_BINARY_DIR})
  set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
  pythonize_bool(LIBCXX_ENABLE_SHARED)
  pythonize_bool(LIBCXX_HAS_STDCXX0X_FLAG)

  set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")

  configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
    ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
    @ONLY)

  add_custom_target(check-libcxx
    COMMAND ${PYTHON_EXECUTABLE}
            ${LIT_EXECUTABLE}
            ${LIT_ARGS}
            ${CMAKE_CURRENT_BINARY_DIR}
    DEPENDS cxx
    COMMENT "Running libcxx tests")
else()
  message(WARNING "Could not find Python, no check target will be available!")
endif()
{'fraction_non_alphanumeric': 0.11737424188369604, 'fraction_numerical': 0.0007135212272565109, 'mean_word_length': 4.641851106639839, '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': '4841880', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1074, 'n_words': 192}