xref: /llvm-project/flang/test/Unit/lit.cfg.py (revision f98ee40f4b5d7474fc67e82824bf6abbaedb7b1c)
193f602b3Ssameeran joshi# -*- Python -*-
293f602b3Ssameeran joshi
393f602b3Ssameeran joshi# Configuration file for the 'lit' test runner.
493f602b3Ssameeran joshi
593f602b3Ssameeran joshiimport os
693f602b3Ssameeran joshi
793f602b3Ssameeran joshiimport lit.formats
893f602b3Ssameeran joshi
993f602b3Ssameeran joshi# name: The name of this test suite.
10*f98ee40fSTobias Hietaconfig.name = "flang-Unit"
1193f602b3Ssameeran joshi
1293f602b3Ssameeran joshi# suffixes: A list of file extensions to treat as test files.
1393f602b3Ssameeran joshiconfig.suffixes = []
1493f602b3Ssameeran joshi
1593f602b3Ssameeran joshi# test_source_root: The root path where unit test binaries are located.
1693f602b3Ssameeran joshi# test_exec_root: The root path where tests should be run.
17*f98ee40fSTobias Hietaconfig.test_source_root = os.path.join(config.flang_obj_root, "unittests")
1893f602b3Ssameeran joshiconfig.test_exec_root = config.test_source_root
1993f602b3Ssameeran joshi
2093f602b3Ssameeran joshi# testFormat: The test format to use to interpret tests.
21*f98ee40fSTobias Hietaconfig.test_format = lit.formats.GoogleTest(config.llvm_build_mode, "Tests")
2293f602b3Ssameeran joshi
2393f602b3Ssameeran joshi# Tweak the PATH to include the tools dir.
24*f98ee40fSTobias Hietapath = os.path.pathsep.join(
25*f98ee40fSTobias Hieta    (config.flang_tools_dir, config.llvm_tools_dir, config.environment["PATH"])
26*f98ee40fSTobias Hieta)
27*f98ee40fSTobias Hietaconfig.environment["PATH"] = path
2893f602b3Ssameeran joshi
29*f98ee40fSTobias Hietapath = os.path.pathsep.join(
30*f98ee40fSTobias Hieta    (
31*f98ee40fSTobias Hieta        config.flang_libs_dir,
32*f98ee40fSTobias Hieta        config.llvm_libs_dir,
33*f98ee40fSTobias Hieta        config.environment.get("LD_LIBRARY_PATH", ""),
34*f98ee40fSTobias Hieta    )
35*f98ee40fSTobias Hieta)
36*f98ee40fSTobias Hietaconfig.environment["LD_LIBRARY_PATH"] = path
3793f602b3Ssameeran joshi
3893f602b3Ssameeran joshi# Propagate PYTHON_EXECUTABLE into the environment
3993f602b3Ssameeran joshi# config.environment['PYTHON_EXECUTABLE'] = sys.executable
4054dc764dSUsman Nadeem
4154dc764dSUsman Nadeem# To modify the default target triple for flang tests.
4254dc764dSUsman Nadeemif config.flang_test_triple:
4354dc764dSUsman Nadeem    config.target_triple = config.flang_test_triple
4454dc764dSUsman Nadeem    config.environment[config.llvm_target_triple_env] = config.flang_test_triple
45