Skip to content

Commit

Permalink
Support filtering out lit tests based on targets (llvm#1087)
Browse files Browse the repository at this point in the history
Currently we ignore what targets llvm was built for in the lit tests, but recent changes to onnx-mlir explicitly initialize the available targets.
This makes the corresponding change to the lit configuration, so that we can filter out the lit tests based on the available targets.

Signed-off-by: Stella Stamenova <stilis@microsoft.com>
  • Loading branch information
sstamenova authored Jan 12, 2022
1 parent 938e3ac commit f39c037
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/mlir/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@
]

llvm_config.add_tool_substitutions(tools, tool_dirs)

# This is based on the same code in llvm and it is meant to determine what
# the supported targets for llvm & friends are - this allow us to filter test
# execution based on the available targets
for arch in config.targets_to_build.split():
config.available_features.add(arch.lower())
1 change: 1 addition & 0 deletions test/mlir/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
config.llvm_tools_dir = r"@LLVM_TOOLS_DIR@"
config.mlir_tools_dir = r"@LLVM_TOOLS_DIR@"
config.python_executable = "@Python3_EXECUTABLE@"
config.targets_to_build = "@TARGETS_TO_BUILD@"

config.onnx_mlir_tools_dir = r"@ONNX_MLIR_TOOLS_DIR@"
config.onnx_mlir_obj_root = r"@ONNX_MLIR_BIN_ROOT@"
Expand Down

0 comments on commit f39c037

Please sign in to comment.