mlir-testutils 0.3.0

Utilities for writing tests that use MLIR.
docs.rs failed to build mlir-testutils-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

mlir-testutils

Utilities for writing tests in crates that use melior.

For the utilities that assert equality between two things you can enable the similar-asserts feature. Enabling this feature makes the assertions use similar-asserts instead of the standard assert_eq macro.

Build requirements

Building this crate requires an LLVM/MLIR 23 installation. The transitive mlir-sys and tblgen build scripts need its llvm-config and TableGen tools, so set both variables to that installation's prefix before running Cargo:

# macOS/Linux with Homebrew
brew install llvm@23
export MLIR_SYS_230_PREFIX="$(brew --prefix llvm@23)"
export TABLEGEN_230_PREFIX="$MLIR_SYS_230_PREFIX"

For a non-Homebrew installation, replace the value with the path to the LLVM installation (the directory containing bin/llvm-config). These settings resolve build errors such as failed to find correct version (23.x.x) of llvm-config from mlir-sys or tblgen.