circt/test/lit.cfg.py

64 lines
1.8 KiB
Python
Raw Normal View History

# -*- Python -*-
import os
import platform
import re
import subprocess
import tempfile
import lit.formats
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import ToolSubst
from lit.llvm.subst import FindTool
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
2020-06-18 01:19:08 +08:00
config.name = 'CIRCT'
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.td', '.mlir', '.ll', '.fir']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
# test_exec_root: The root path where tests should be run.
2020-06-18 01:19:08 +08:00
config.test_exec_root = os.path.join(config.circt_obj_root, 'test')
config.substitutions.append(('%PATH%', config.environment['PATH']))
config.substitutions.append(('%shlibext', config.llvm_shlib_ext))
llvm_config.with_system_environment(
['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])
llvm_config.use_default_substitutions()
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
# test_exec_root: The root path where tests should be run.
2020-06-18 01:19:08 +08:00
config.test_exec_root = os.path.join(config.circt_obj_root, 'test')
# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
2020-06-18 01:19:08 +08:00
tool_dirs = [config.circt_tools_dir, config.mlir_tools_dir, config.llvm_tools_dir]
tools = [
'firtool',
2020-06-18 05:14:02 +08:00
'handshake-runner',
2020-06-18 01:19:08 +08:00
'circt-opt',
'circt-translate',
Merge LLHD project into CIRCT (#14) * Merge LLHD project into CIRCT * Split LLHDOps.td into multiple smaller files * move LLHDToLLVM init definition and prune includes * Format tablegen files with 2 space indent, 80 col width; move out trait helper function * Move implementation logic from LLHDOps.h to cpp file * Empty lines for breathing space; nicer operation separators * Move simulator to Dialect/LLHD/Simulator * move `State.h` and `signal-runtime-wrappers.h` to lib directory * pass ModuleOp by value * make getters const, return ModuleOp by value * Use isa, cast, dyn_cast appropriately * wrap struct in anon namespace; make helpers static * [cmake] Fold into LINK_LIBS * fix for loops * replace floating point with `divideCeil` * prune redundant includes * make llhd-sim helpers static * remove StandardToLLVM pass registration * move verilog printer to cpp file, add global function as public API * Move transformation pass base classes and registration to lib, add file header boilerplate * Few improvements * Return diagnostics directly * isa instead of kindof * Improve walks * etc. * add 'using namespace llvm;' again * Always pass a location when creating new ops * Improve cmake files * remove unnecessary `LLVMSupport` links. * add `PUBLIC` where missing. * move LLVMCore under `LINK_COMPONENTS`. * Add file headers and improve simulator comments * Some LLHDToLLVM improvements * Fix walks. * Use `std::array` instead of `SmallVector` when resize is not needed. * Fix a potential sefgault by passing an ArrayRef with no data owner. * Remove some unnecessary steps. * Remove some unnecessary const strings. * Add new LowerToLLVMOptions argument The new argument was added in 10643c9ad85bf072816bd271239281ec50a52e31. * Add missing file header boilerplate and newline * Improve for-loop * use static instead of anonymous namespace for functions * fit to 80 columns, cast instead of dyn_cast * Changes for LLVM update * use llvm format instead of std::stringstream and iomanip Co-authored-by: rodonisi <simon@rodoni.ch>
2020-07-03 02:04:33 +08:00
'llhd-sim'
]
llvm_config.add_tool_substitutions(tools, tool_dirs)