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