xref: /llvm-project/flang/test/Unit/lit.cfg.py (revision f98ee40f4b5d7474fc67e82824bf6abbaedb7b1c)
1# -*- Python -*-
2
3# Configuration file for the 'lit' test runner.
4
5import os
6
7import lit.formats
8
9# name: The name of this test suite.
10config.name = "flang-Unit"
11
12# suffixes: A list of file extensions to treat as test files.
13config.suffixes = []
14
15# test_source_root: The root path where unit test binaries are located.
16# test_exec_root: The root path where tests should be run.
17config.test_source_root = os.path.join(config.flang_obj_root, "unittests")
18config.test_exec_root = config.test_source_root
19
20# testFormat: The test format to use to interpret tests.
21config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, "Tests")
22
23# Tweak the PATH to include the tools dir.
24path = os.path.pathsep.join(
25    (config.flang_tools_dir, config.llvm_tools_dir, config.environment["PATH"])
26)
27config.environment["PATH"] = path
28
29path = os.path.pathsep.join(
30    (
31        config.flang_libs_dir,
32        config.llvm_libs_dir,
33        config.environment.get("LD_LIBRARY_PATH", ""),
34    )
35)
36config.environment["LD_LIBRARY_PATH"] = path
37
38# Propagate PYTHON_EXECUTABLE into the environment
39# config.environment['PYTHON_EXECUTABLE'] = sys.executable
40
41# To modify the default target triple for flang tests.
42if config.flang_test_triple:
43    config.target_triple = config.flang_test_triple
44    config.environment[config.llvm_target_triple_env] = config.flang_test_triple
45