blob: 77a049855cc096e7bba0a3fe4b7a29d82638c13c [file] [log] [blame]
Stella Laurenzo9bde61b2022-04-21 15:37:14 -07001# Copyright 2022 The IREE Authors
2#
3# Licensed under the Apache License v2.0 with LLVM Exceptions.
4# See https://llvm.org/LICENSE.txt for license information.
5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6"""Lit config for IREE."""
7
8# Lint for undefined variables is disabled as config is not defined inside this
9# file, instead config is injected by way of evaluating runlit.cfg.py from
10# runlit.site.cfg.py which in turn is evaluated by lit.py.
11# pylint: disable=undefined-variable
12
13import os
14import tempfile
15
16import lit.formats
17
18config.name = "IREE"
19config.suffixes = [".mlir", ".txt"]
20config.test_format = lit.formats.ShTest(execute_external=True)
21# Forward all IREE environment variables
22passthrough_env_vars = ["VK_ICD_FILENAMES"]
23config.environment.update({
24 k: v
25 for k, v in os.environ.items()
26 if k.startswith("IREE_") or k in passthrough_env_vars
27})
28
29# Use the most preferred temp directory.
30config.test_exec_root = (os.environ.get("TEST_UNDECLARED_OUTPUTS_DIR") or
31 os.environ.get("TEST_TMPDIR") or
32 os.path.join(tempfile.gettempdir(), "lit"))