Skip to content

Commit 583dbab

Browse files
committed
Some more information on LIT tests
1 parent da72734 commit 583dbab

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

DEVDOCS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,14 @@ Run tests with:
7979
```bash
8080
bazel test //test/...
8181
```
82+
This runs the tests in
83+
84+
Most of the Enzyme-JaX tests use [lit](https://llvm.org/docs/CommandGuide/lit.html) for testing.
85+
These tests are stored in `test/lit_tests`.
86+
A lit test contains one or more run directives at the top a file.
87+
e.g. in `test/lit_tests/if.mlir`:
88+
```mlir
89+
// RUN: enzymexlamlir-opt %s --enzyme-hlo-opt | FileCheck %s
90+
```
91+
This instructs `lit` to run the `enzyme-hlo-opt` pass on `test/lit_tests/if.mlir`.
92+
The output is fed to `FileCheck` which compares it against the expected result that is provided in comments in the file that start with `// CHECK`.

0 commit comments

Comments
 (0)