Files
carbon-lang/toolchain/semantics/testdata/lit.cfg.py
T
Jon Ross-Perkins 80570e1a5b Modify the driver to support using for semantics IR testing (#2222)
This unifies `dump-tokens` and `dump-parse-tree` so that we don't keep writing basically the same code repeatedly.

I'll need to modify the output of SemanticsIR::Print more, and may soon unify printing multiple IRs this way (particularly including the builtins SemanticsIR) but this is intended to offer a starting point.

I may eventually try to unify lit.cfg.py files, but I was thinking about whether that works in various contexts we may run in and eventually decided copying the driver/testdata/lit.cfg.py file would be the easiest solution.
2022-09-28 17:40:57 -07:00

36 lines
858 B
Python

__copyright__ = """
Part of the Carbon Language project, under the Apache License v2.0 with LLVM
Exceptions. See /LICENSE for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""
import lit.formats
import os
# This is a provided variable, ignore the undefined name warning.
config = config # noqa: F821
def fullpath(relative_path):
return os.path.join(os.environ["TEST_SRCDIR"], relative_path)
config.name = "lit"
config.suffixes = [".carbon"]
config.test_format = lit.formats.ShTest()
config.substitutions.append(
(
"%{carbon}",
fullpath("carbon/toolchain/driver/carbon"),
)
)
config.substitutions.append(("%{not}", fullpath("llvm-project/llvm/not")))
config.substitutions.append(
(
"%{FileCheck}",
fullpath("llvm-project/llvm/FileCheck --dump-input-filter=all"),
)
)