<commit_before>function(add_python_test_target name test_script args comment)
  set(PYTHON_TEST_COMMAND
    ${PYTHON_EXECUTABLE}
    ${test_script}
    ${args}
    )

  add_custom_target(${name}
    COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
    COMMENT "${comment}"
    DEPENDS ${LLDB_TEST_DEPS}
    USES_TERMINAL
    )
endfunction()

set(LLDB_TEST_DEPS lldb)

if(TARGET lldb-server)
  list(APPEND LLDB_TEST_DEPS lldb-server)
endif()
  
if(TARGET debugserver)
  list(APPEND LLDB_TEST_DEPS debugserver)
endif()

if(TARGET lldb-mi)
  list(APPEND LLDB_TEST_DEPS lldb-mi)
endif()

# This target will only exist if the user is using a CMake older than 3.7
if(TARGET lldb_header_symlink)
  list(APPEND LLDB_TEST_DEPS lldb_header_symlink)
endif()

if ("${LLDB_TEST_COMPILER}" STREQUAL "")
    string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
endif()

# The default architecture with which to compile test executables is the default LLVM target
# architecture, which itself defaults to the host architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH)
if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" )
  string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE})
endif ()

# Allow the user to override the default by setting LLDB_TEST_ARCH
set(LLDB_TEST_ARCH
	${LLDB_DEFAULT_TEST_ARCH}
	CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64).  Determines whether tests are compiled with -m32 or -m64")

# Scrub LLDB_TEST_COMPILER out of the CMake caches
# TODO: remove the replace lines and the FORCE parameter in a few days once the
# change has made its way through bots to clean up their CMake caches.
string(REPLACE "-C;${LLDB_TEST_COMPILER}" "" LLDB_TEST_USER_ARGS_New "${LLDB_TEST_USER_ARGS}")

# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script
set(LLDB_TEST_USER_ARGS
  "${LLDB_TEST_USER_ARGS_New}"
  CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'" FORCE)

set(LLDB_TEST_COMMON_ARGS
  --arch=${LLDB_TEST_ARCH}
  --executable $<TARGET_FILE:lldb>
  -s
  ${CMAKE_BINARY_DIR}/lldb-test-traces
  -S nm<commit_msg>[CMake] Support LLDB_TEST_CLANG in check-lldb target(s)<commit_after>function(add_python_test_target name test_script args comment)
  set(PYTHON_TEST_COMMAND
    ${PYTHON_EXECUTABLE}
    ${test_script}
    ${args}
    )

  add_custom_target(${name}
    COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
    COMMENT "${comment}"
    DEPENDS ${LLDB_TEST_DEPS}
    USES_TERMINAL
    )
endfunction()

set(LLDB_TEST_DEPS lldb)

if(TARGET lldb-server)
  list(APPEND LLDB_TEST_DEPS lldb-server)
endif()
  
if(TARGET debugserver)
  list(APPEND LLDB_TEST_DEPS debugserver)
endif()

if(TARGET lldb-mi)
  list(APPEND LLDB_TEST_DEPS lldb-mi)
endif()

# This target will only exist if the user is using a CMake older than 3.7
if(TARGET lldb_header_symlink)
  list(APPEND LLDB_TEST_DEPS lldb_header_symlink)
endif()

if ("${LLDB_TEST_COMPILER}" STREQUAL "")
    string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
endif()

# The default architecture with which to compile test executables is the default LLVM target
# architecture, which itself defaults to the host architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH)
if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" )
  string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE})
endif ()

# Allow the user to override the default by setting LLDB_TEST_ARCH
set(LLDB_TEST_ARCH
	${LLDB_DEFAULT_TEST_ARCH}
	CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64).  Determines whether tests are compiled with -m32 or -m64")

# Scrub LLDB_TEST_COMPILER out of the CMake caches
# TODO: remove the replace lines and the FORCE parameter in a few days once the
# change has made its way through bots to clean up their CMake caches.
string(REPLACE "-C;${LLDB_TEST_COMPILER}" "" LLDB_TEST_USER_ARGS_New "${LLDB_TEST_USER_ARGS}")

if(LLDB_TEST_CLANG)
  set(LLDB_TEST_COMPILER $<TARGET_FILE:clang>)
endif()

# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script
set(LLDB_TEST_USER_ARGS
  "${LLDB_TEST_USER_ARGS_New}"
  CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'" FORCE)

set(LLDB_TEST_COMMON_ARGS
  --arch=${LLDB_TEST_ARCH}
  --executable $<TARGET_FILE:lldb>
  -s
  ${CMAKE_BINARY_DIR}/lldb-test-traces
  -S nm
{'fraction_non_alphanumeric': 0.09088918090232151, 'fraction_numerical': 0.00788436268068331, 'mean_word_length': 5.432394366197183, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '4359944', 'n_tokens_mistral': 1706, 'n_tokens_neox': 1666, 'n_words': 446}