• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- Python -*-
2
3# Configuration file for 'lit' test runner.
4# This file contains common config setup rules for unit tests in various
5# compiler-rt testsuites.
6
7import os
8
9import lit.formats
10
11# Setup test format
12llvm_build_mode = getattr(config, "llvm_build_mode", "Debug")
13config.test_format = lit.formats.GoogleTest(llvm_build_mode, "Test")
14
15# Setup test suffixes.
16config.suffixes = []
17
18# Tweak PATH to include llvm tools dir.
19llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
20if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
21  lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
22path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
23config.environment['PATH'] = path
24
25# Propagate the temp directory. Windows requires this because it uses \Windows\
26# if none of these are present.
27if 'TMP' in os.environ:
28    config.environment['TMP'] = os.environ['TMP']
29if 'TEMP' in os.environ:
30    config.environment['TEMP'] = os.environ['TEMP']
31