From 757b9c0e808f14f8ab1aef1fc804dde0f6e6575e Mon Sep 17 00:00:00 2001 From: qiming chu Date: Tue, 14 Jan 2025 23:54:09 +0800 Subject: [PATCH] update documentation for lit test (#4613) * update documentation for lit test * minor changes for lit-test doc --- docs/src/developers/lit-test.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/src/developers/lit-test.md b/docs/src/developers/lit-test.md index 5d89c3abf1f..db0647b81dc 100644 --- a/docs/src/developers/lit-test.md +++ b/docs/src/developers/lit-test.md @@ -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`. @@ -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.