lit.cfg.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. __copyright__ = """
  2. Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  3. Exceptions. See /LICENSE for license information.
  4. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  5. """
  6. import lit.formats
  7. import os
  8. # This is a provided variable, ignore the undefined name warning.
  9. config = config # noqa: F821
  10. def fullpath(relative_path):
  11. return os.path.join(os.environ["TEST_SRCDIR"], relative_path)
  12. config.name = "lit"
  13. config.suffixes = [".carbon"]
  14. config.test_format = lit.formats.ShTest()
  15. config.substitutions.append(
  16. ("%{prelude}", fullpath("carbon/executable_semantics/data/prelude.carbon"))
  17. )
  18. config.substitutions.append(
  19. (
  20. "%{executable_semantics}",
  21. "%s --prelude=%s"
  22. % (
  23. fullpath("carbon/executable_semantics/executable_semantics"),
  24. fullpath("carbon/executable_semantics/data/prelude.carbon"),
  25. ),
  26. )
  27. )
  28. config.substitutions.append(("%{not}", fullpath("llvm-project/llvm/not")))
  29. config.substitutions.append(
  30. (
  31. "%{FileCheck}",
  32. fullpath("llvm-project/llvm/FileCheck --dump-input-filter=all"),
  33. )
  34. )