2012-08-07 16:59:15 +08:00
|
|
|
# -*- Python -*-
|
|
|
|
|
|
|
|
# Configuration file for 'lit' test runner.
|
|
|
|
# This file contains common config setup rules for unit tests in various
|
|
|
|
# compiler-rt testsuites.
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2013-08-10 06:23:23 +08:00
|
|
|
import lit.formats
|
|
|
|
|
2012-08-07 16:59:15 +08:00
|
|
|
# Setup test format
|
2013-01-30 20:18:49 +08:00
|
|
|
llvm_build_mode = getattr(config, "llvm_build_mode", "Debug")
|
|
|
|
config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test")
|
2012-08-07 16:59:15 +08:00
|
|
|
|
|
|
|
# Setup test suffixes.
|
|
|
|
config.suffixes = []
|
|
|
|
|
2013-09-08 21:23:29 +08:00
|
|
|
# Tweak PATH to include llvm tools dir.
|
|
|
|
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
|
|
|
|
if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
|
|
|
|
lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
|
|
|
|
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
|
|
|
|
config.environment['PATH'] = path
|
|
|
|
|
2012-08-07 16:59:15 +08:00
|
|
|
# Propagate the temp directory. Windows requires this because it uses \Windows\
|
|
|
|
# if none of these are present.
|
|
|
|
if 'TMP' in os.environ:
|
|
|
|
config.environment['TMP'] = os.environ['TMP']
|
|
|
|
if 'TEMP' in os.environ:
|
|
|
|
config.environment['TEMP'] = os.environ['TEMP']
|