<commit_before># -*- Python -*-

# Configuration file for the 'lit' test runner.

# name: The name of this test suite.
config.name = 'Clang'

# testFormat: The test format to use to interpret tests.
#
# For now we require '&&' between commands, until they get globally killed and
# the test runner updated.
config.test_format = lit.formats.ShTest(execute_external = True)

# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c', '.cpp', '.m', '.mm']

# target_triple: Used by ShTest and TclTest formats for XFAIL checks.
config.target_triple = 'foo'

###

# Discover the 'clang' and 'clangcc' to use.

import os

def inferClang(PATH):
    # Determine which clang to use.
    clang = os.getenv('CLANG')

    # If the user set clang in the environment, definitely use that and don't
    # try to validate.
    if clang:
        return clang

    # Otherwise look in the path.
    clang = lit.util.which('clang', PATH)

    if not clang:
        lit.fatal("couldn't find 'clang' program, try setting "
                  "CLANG in your environment")

    return clang

def inferClangCC(clang, PATH):
    clangcc = os.getenv('CLANGCC')

    # If the user set clang in the environment, definitely use that and don't
    # try to validate.
    if clangcc:
        return clangcc

    # Otherwise try adding -cc since we expect to be looking in a build
    # directory.
    if clang.endswith('.exe'):
        clangccName = clang[:-4] + '-cc.exe'
    else:
        clangccName = clang + '-cc'
    clangcc = lit.util.which(clangccName, PATH)
    if not clangcc:
        # Otherwise ask clang.
        res = lit.util.capture([clang, '-print-prog-name=clang-cc'])
        res = res.strip()
        if res and os.path.exists(res):
            clangcc = res

    if not clangcc:
        lit.fatal("couldn't find 'clang-cc' program, try setting "
                  "CLANGCC in your environment")

    return clangcc

clang = inferClang(config.environment['PATH'])
if not lit.quiet:
    lit.note('using clang: %r' % clang)
config.substitutions.append( (' clang ', ' ' + clang + ' ') )

clang_cc = inferClangCC(clang, config.environment['PATH'])
if not lit.quiet:
    lit.note('using clang-cc: %r' % clang_cc)
config.substitutions.append( (' clang-cc ', ' ' + clang_cc + ' ') )<commit_msg>lit: Tweak example tests config.<commit_after># -*- Python -*-

# Configuration file for the 'lit' test runner.

# name: The name of this test suite.
config.name = 'Clang'

# testFormat: The test format to use to interpret tests.
#
# For now we require '&&' between commands, until they get globally killed and
# the test runner updated.
config.test_format = lit.formats.ShTest(execute_external = True)

# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c', '.cpp', '.m', '.mm']

# target_triple: Used by ShTest and TclTest formats for XFAIL checks.
config.target_triple = 'foo'

###

# Discover the 'clang' and 'clangcc' to use.

import os

def inferClang(PATH):
    # Determine which clang to use.
    clang = os.getenv('CLANG')

    # If the user set clang in the environment, definitely use that and don't
    # try to validate.
    if clang:
        return clang

    # Otherwise look in the path.
    clang = lit.util.which('clang', PATH)

    if not clang:
        lit.fatal("couldn't find 'clang' program, try setting "
                  "CLANG in your environment")

    return clang

clang = inferClang(config.environment['PATH'])
if not lit.quiet:
    lit.note('using clang: %r' % clang)
config.substitutions.append( (' clang ', ' ' + clang + ' ') )
{'fraction_non_alphanumeric': 0.11902113459399333, 'fraction_numerical': 0.00027808676307007786, 'mean_word_length': 2.9225736095965105, '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': '6707016', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1146, 'n_words': 394}