Skip to content

Commit 757b9c0

Browse files
authored
update documentation for lit test (#4613)
* update documentation for lit test * minor changes for lit-test doc
1 parent ba4e01c commit 757b9c0

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

docs/src/developers/lit-test.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ section: "chisel3"
88

99
We used llvm-lit and scala-cli to test CIRCT Converter. For how this tool works, see [lit - LLVM Integrated Tester](https://llvm.org/docs/CommandGuide/lit.html).
1010

11+
Ensure that the `lit`, `llvm`, and `scala-cli` tools are available in your environment.
12+
1113
## Run tests
1214

1315
The first line of the test file indicates how the test will be run, mostly in the form of `scala-cli ... | FileCheck`.
@@ -24,11 +26,21 @@ mill -i lit[_].run
2426

2527
There is a lack of a convenient way to debug test cases. But the `println` debugging method always works.
2628

27-
You need to temporarily modify `tests.sc` to make `lit` output more detailed (stdout, stderr).
29+
You need to temporarily modify `panama.sc` to make `lit` output more detailed (stdout, stderr).
2830

2931
```diff
30-
-os.proc("lit", litConfig().path)
31-
+os.proc("lit", litConfig().path, "-a")
32+
diff --git a/panama.sc b/panama.sc
33+
--- a/panama.sc
34+
+++ b/panama.sc
35+
@@ -243,7 +243,7 @@ trait LitModule extends Module {
36+
PathRef(T.dest)
37+
}
38+
def run(args: String*) = T.command(
39+
- os.proc("lit", litConfig().path)
40+
+ os.proc("lit", litConfig().path, "-a")
41+
.call(T.dest, stdout = os.ProcessOutput.Readlines(line => T.ctx().log.info("[lit] " + line)))
42+
)
43+
}
3244
```
3345

3446
If the output of `FileCheck` confuses you, you will also need to temporarily remove the `| FileCheck ...` from the test case file header.

0 commit comments

Comments
 (0)