blob: 29f10a89e749ddaecdf7ad731e0c7928c79527b3 [file] [edit]
# -*- Python -*-
import os
import platform
import lit.formats
import lit.util
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
config.name = 'LNT'
# testFormat: The test format to use to interpret tests.
config.test_format = lit.formats.ShTest()
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.py', '.shtest']
# excludes: A list of individual files to exclude.
config.excludes = ['__init__.py', 'Inputs', 'utils']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(os.path.abspath(__file__))
config.test_exec_root = 'test_run_tmp'
config.target_triple = None
# LNT needs a UTF-8 locale when running in Python 3 mode. Rely on the host
# environment to provide it rather than assume a specific UTF-8 locale is
# present.
config.environment['LANG'] = os.environ['LANG']
# Don't generate .pyc files when running tests.
config.environment['PYTHONDONTWRITEBYTECODE'] = "1"
config.environment['SUDO_CMD'] = ""
config.environment['I'] = ""
src_root = os.path.join(config.test_source_root, '..')
config.substitutions.append(('%{src_root}', src_root))
config.substitutions.append(('%{shared_inputs}', os.path.join(config.test_source_root, 'utils', 'Inputs')))
config.substitutions.append(('%{utils}', os.path.join(config.test_source_root, 'utils')))
config.substitutions.append(('%{test_exec_root}', config.test_exec_root))
if lit_config.params.get('long', None):
config.available_features.add('long')
# Enable tidylib testing. This requires pytidylib and tidy-html5.
if lit_config.params.get('tidylib', None):
config.substitutions.append(('%{tidylib}', '--use-tidylib'))
else:
config.substitutions.append(('%{tidylib}', ''))
config.available_features.add(platform.system())
# Enable coverage.py reporting, assuming the coverage module has been installed
# and sitecustomize.py in the virtualenv has been modified appropriately.
if lit_config.params.get('check-coverage', None):
config.environment['COVERAGE_PROCESS_START'] = os.path.join(
os.path.dirname(__file__), ".coveragerc")