blob: cc344cbed8cd6e6c029710787401188306bb58e0 [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"]
Jakub Kuderskibe24f022023-06-21 14:44:18 -040023config.environment.update(
24 {
25 k: v
26 for k, v in os.environ.items()
27 if k.startswith("IREE_") or k in passthrough_env_vars
28 }
29)
Stella Laurenzo9bde61b2022-04-21 15:37:14 -070030
31# Use the most preferred temp directory.
Jakub Kuderskibe24f022023-06-21 14:44:18 -040032config.test_exec_root = (
33 os.environ.get("TEST_UNDECLARED_OUTPUTS_DIR")
34 or os.environ.get("TEST_TMPDIR")
35 or os.path.join(tempfile.gettempdir(), "lit")
36)