Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update documentation for lit test #4613

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions docs/src/developers/lit-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ section: "chisel3"

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).

Ensure that the `lit`, `llvm`, and `scala-cli` tools are available in your environment.

## Run tests

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

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

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

```diff
-os.proc("lit", litConfig().path)
+os.proc("lit", litConfig().path, "-a")
diff --git a/panama.sc b/panama.sc
--- a/panama.sc
+++ b/panama.sc
@@ -243,7 +243,7 @@ trait LitModule extends Module {
PathRef(T.dest)
}
def run(args: String*) = T.command(
- os.proc("lit", litConfig().path)
+ os.proc("lit", litConfig().path, "-a")
.call(T.dest, stdout = os.ProcessOutput.Readlines(line => T.ctx().log.info("[lit] " + line)))
)
}
```

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