-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for running FileCheck tests in the Bazel build (#1321)
Add support for running FileCheck tests in the Bazel build Before this PR, only CMake build could actually ran tests, and Bazel build could only build things. With this PR, Bazel build can now test everything except for a few tests that involve Python bindings. This is relatively acceptable for now, and we have #362 to keep track of specifically Python tests. While learning about FileCheck support in Bazel and applying this knowledge to our repositoru, I discovered that our CMake build for FileCheck tests was vastly overcomplicated, so I simplified it considerably. Finally, I noticed that ci_build_llvm.sh builds mlir-cpu-runner. This is something that we got rid of in README.md recently, and I don't think we need this in CI either. Fixes #1315
- Loading branch information
Eugene Burmako
authored
Mar 13, 2023
1 parent
03e820f
commit 551db9e
Showing
19 changed files
with
265 additions
and
326 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2023 The StableHLO Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template") | ||
load("@llvm-project//llvm:lit_test.bzl", "lit_test", "package_path") | ||
|
||
package( | ||
default_visibility = ["//visibility:public"], | ||
licenses = ["notice"], | ||
) | ||
|
||
# Equivalent of configure_lit_site_cfg from CMakeLists.txt. | ||
expand_template( | ||
name = "lit_site_cfg_py_gen", | ||
testonly = True, | ||
out = "lit.site.cfg.py", | ||
substitutions = { | ||
"@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.", | ||
"@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"), | ||
"@STABLEHLO_TOOLS_DIR@": ".", | ||
"@STABLEHLO_SOURCE_DIR@": ".", | ||
}, | ||
template = "lit.site.cfg.py.in", | ||
) | ||
|
||
# Equivalent of add_lit_testsuite from CMakeLists.txt. | ||
[ | ||
lit_test( | ||
name = "%s.test" % src, | ||
srcs = [src], | ||
data = [ | ||
"lit.cfg.py", | ||
"lit.site.cfg.py", | ||
"//:stablehlo-opt", | ||
"//:stablehlo-translate", | ||
"@llvm-project//llvm:FileCheck", | ||
] + glob(["%s.*.bc" % src]), | ||
size = "small", | ||
) | ||
for src in glob(["**/*.mlir"]) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.