mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +01:00
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.
36 lines
858 B
Python
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"),
|
|
)
|
|
)
|