-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split tests into two packages in Bazel build.
This separates MLIR tests and regular Enzyme integration tests into independent packages, making sure only a subset of targets is rebuilt and retested when requested to decrease overhead.
- Loading branch information
Showing
4 changed files
with
88 additions
and
51 deletions.
There are no files selected for viewing
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,32 @@ | ||
# Enzyme tests. | ||
|
||
load("@llvm-project//llvm:lit_test.bzl", "package_path") | ||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template") | ||
|
||
# Generates lit config input file by applying path placeholder substitutions | ||
# similar to the configure_lit_site_cfg CMake macro. | ||
expand_template( | ||
name = "lit_site_cfg_py", | ||
testonly = True, | ||
out = "lit.site.cfg.py", | ||
substitutions = { | ||
"@LLVM_VERSION_MAJOR@": "18", | ||
"@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.", | ||
"@LLVM_BINARY_DIR@": package_path("@llvm-project//llvm:BUILD"), | ||
"@LLVM_TOOLS_BINARY_DIR@": package_path("@llvm-project//llvm:BUILD"), | ||
"@LLVM_LIBS_DIR@": package_path("@llvm-project//llvm:BUILD"), | ||
"@ENZYME_SOURCE_DIR@": "", | ||
"@ENZYME_BINARY_DIR@": "", | ||
"@TARGET_TRIPLE@": "", | ||
"@TARGETS_TO_BUILD@": "ALL", | ||
"@LLVM_SHLIBEXT@": ".so", | ||
}, | ||
template = "lit.site.cfg.py.in", | ||
visibility = [":__subpackages__"], | ||
) | ||
|
||
exports_files( | ||
["lit.cfg.py"], | ||
visibility = [":__subpackages__"], | ||
) | ||
|
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,29 @@ | ||
# Enzyme integration tests. | ||
|
||
load("@llvm-project//llvm:lit_test.bzl", "lit_test") | ||
|
||
[ | ||
lit_test( | ||
name = "%s.test" % src, | ||
srcs = [src], | ||
data = [ | ||
"//:enzyme-clang", | ||
"//:enzyme-clang++", | ||
"//:enzyme-opt", | ||
"//test:lit.cfg.py", | ||
"//test:lit.site.cfg.py", | ||
"@llvm-project//clang:builtin_headers_gen", | ||
"@llvm-project//llvm:FileCheck", | ||
"@llvm-project//llvm:count", | ||
"@llvm-project//llvm:lli", | ||
"@llvm-project//llvm:not", | ||
] + glob(["**/*.h"]), | ||
) | ||
for src in glob( | ||
[ | ||
"**/*.c", | ||
"**/.cpp", | ||
], | ||
exclude = ["**/*omp*.c"], | ||
) | ||
] |
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,25 @@ | ||
# MLIR-specific tests for Enzyme. | ||
|
||
load("@llvm-project//llvm:lit_test.bzl", "lit_test") | ||
|
||
[ | ||
lit_test( | ||
name = "%s.test" % src, | ||
srcs = [src], | ||
data = [ | ||
"//:enzymemlir-opt", | ||
"//test:lit.cfg.py", | ||
"//test:lit.site.cfg.py", | ||
"@llvm-project//clang:builtin_headers_gen", | ||
"@llvm-project//llvm:FileCheck", | ||
"@llvm-project//llvm:count", | ||
"@llvm-project//llvm:lli", | ||
"@llvm-project//llvm:not", | ||
] + glob(["**/*.h"]), | ||
) | ||
for src in glob( | ||
[ | ||
"**/*.mlir", | ||
], | ||
) | ||
] |