<commit_before># -*- Python -*-

# Configuration file for the 'lit' test runner.

import os
import platform
import shlex

import lit.formats

# name: The name of this test suite.
config.name = 'lldb-Suite'

# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.py']

# test_source_root: The root path where tests are located.
# test_exec_root: The root path where tests should be run.
config.test_source_root = os.path.join(config.lldb_src_root, 'packages',
                                       'Python', 'lldbsuite', 'test')
config.test_exec_root = config.test_source_root

if 'Address' in config.llvm_use_sanitizer:
  config.environment['ASAN_OPTIONS'] = 'detect_stack_use_after_return=1'
  # macOS flags needed for LLDB built with address sanitizer.
  if 'Darwin' in config.host_os and 'x86' in config.host_triple:
    import subprocess
    resource_dir = subprocess.check_output(
        [config.cmake_cxx_compiler, '-print-resource-dir']).strip()
    runtime = os.path.join(resource_dir, 'lib', 'darwin',
                           'libclang_rt.asan_osx_dynamic.dylib')
    config.environment['DYLD_INSERT_LIBRARIES'] = runtime

# Shared library build of LLVM may require LD_LIBRARY_PATH or equivalent.
def find_shlibpath_var():
  if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
    yield 'LD_LIBRARY_PATH'
  elif platform.system() == 'Darwin':
    yield 'DYLD_LIBRARY_PATH'
  elif platform.system() == 'Windows':
    yield 'PATH'

for shlibpath_var in find_shlibpath_var():
  # In stand-alone build llvm_shlib_dir specifies LLDB's lib directory
  # while llvm_libs_dir specifies LLVM's lib directory.
  shlibpath = os.path.pathsep.join(
    (config.llvm_shlib_dir,
     config.llvm_libs_dir,
     config.environment.get(shlibpath_var, '')))
  config.environment[shlibpath_var] = shlibpath
  break
else:
  lit_config.warning("unable to inject shared library path on '{}'"
                     .format(platform.system()))

# Build dotest command.
dotest_cmd = [config.dotest_path, '-q']
dotest_cmd.extend(config.dotest_args_str.split(';'))

# We don't want to force users passing arguments to lit to use `;` as a
# separator. We use Python's simple lexical analyzer to turn the args into a
# list.
if config.dotest_lit_args_str:
  dotest_cmd.extend(shlex.split(config.dotest_lit_args_str))

# Library path may be needed to locate just-built clang.
if config.llvm_libs_dir:
  dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]

# Load LLDB test format.
sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite"))
import lldbtest<commit_msg>[lit] Don't set DYLD_LIBRARY_PATH when DYLD_INSERT_LIBRARIES is set.<commit_after># -*- Python -*-

# Configuration file for the 'lit' test runner.

import os
import platform
import shlex

import lit.formats

# name: The name of this test suite.
config.name = 'lldb-Suite'

# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.py']

# test_source_root: The root path where tests are located.
# test_exec_root: The root path where tests should be run.
config.test_source_root = os.path.join(config.lldb_src_root, 'packages',
                                       'Python', 'lldbsuite', 'test')
config.test_exec_root = config.test_source_root

if 'Address' in config.llvm_use_sanitizer:
  config.environment['ASAN_OPTIONS'] = 'detect_stack_use_after_return=1'
  # macOS flags needed for LLDB built with address sanitizer.
  if 'Darwin' in config.host_os and 'x86' in config.host_triple:
    import subprocess
    resource_dir = subprocess.check_output(
        [config.cmake_cxx_compiler, '-print-resource-dir']).strip()
    runtime = os.path.join(resource_dir, 'lib', 'darwin',
                           'libclang_rt.asan_osx_dynamic.dylib')
    config.environment['DYLD_INSERT_LIBRARIES'] = runtime

def find_shlibpath_var():
  if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
    yield 'LD_LIBRARY_PATH'
  elif platform.system() == 'Darwin':
    yield 'DYLD_LIBRARY_PATH'
  elif platform.system() == 'Windows':
    yield 'PATH'

if not config.environment['DYLD_INSERT_LIBRARIES']:
  # Shared library build of LLVM may require LD_LIBRARY_PATH or equivalent.
  # This clashes with DYLD_INSERT_LIBRARIES which is needed on Darwin.
  for shlibpath_var in find_shlibpath_var():
    # In stand-alone build llvm_shlib_dir specifies LLDB's lib directory while
    # llvm_libs_dir specifies LLVM's lib directory.
    shlibpath = os.path.pathsep.join(
      (config.llvm_shlib_dir,
      config.llvm_libs_dir,
      config.environment.get(shlibpath_var, '')))
    config.environment[shlibpath_var] = shlibpath
    break
  else:
    lit_config.warning("unable to inject shared library path on '{}'"
                      .format(platform.system()))

# Build dotest command.
dotest_cmd = [config.dotest_path, '-q']
dotest_cmd.extend(config.dotest_args_str.split(';'))

# We don't want to force users passing arguments to lit to use `;` as a
# separator. We use Python's simple lexical analyzer to turn the args into a
# list.
if config.dotest_lit_args_str:
  dotest_cmd.extend(shlex.split(config.dotest_lit_args_str))

# Library path may be needed to locate just-built clang.
if config.llvm_libs_dir:
  dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]

# Load LLDB test format.
sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite"))
import lldbtest
{'fraction_non_alphanumeric': 0.10834715312327253, 'fraction_numerical': 0.001105583195135434, 'mean_word_length': 4.012003693444137, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5349861', 'n_tokens_mistral': 1862, 'n_tokens_neox': 1791, 'n_words': 474}