summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2025-03-11 09:26:08 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2025-04-18 21:52:59 +0900
commit9137e24b54e6ae3d2bb0703adbb97c0d392a04d2 (patch)
treeb7e18c3436a6eae610e54fb6b96bc5af6ed74ce5 /doc
parentbe8c78f20dd5eaf31d1514319e60d904aad6dbd5 (diff)
Add a make target to run all ZJIT tests (https://github.com/Shopify/zjit/pull/49)
* Add a make target to run all ZJIT tests * Remove an unused variable * Write up a document about testing * Explain zjit-test-all first * Clarify what's zjit-test-all
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
Diffstat (limited to 'doc')
-rw-r--r--doc/zjit.md44
1 files changed, 43 insertions, 1 deletions
diff --git a/doc/zjit.md b/doc/zjit.md
index 5ca0018d01..264677f0b1 100644
--- a/doc/zjit.md
+++ b/doc/zjit.md
@@ -31,7 +31,33 @@ To run code snippets with ZJIT:
You can also try https://www.rubyexplorer.xyz/ to view Ruby YARV disasm output with syntax highlighting
in a way that can be easily shared with other team members.
-## Unit Testing (`make zjit-test`)
+## Testing
+
+### make zjit-test-all
+
+This command runs all ZJIT tests: `make zjit-test` and `test/ruby/test_zjit.rb`.
+
+```
+make zjit-test-all
+```
+
+### make zjit-test
+
+This command runs Rust unit tests.
+
+```
+make zjit-test
+```
+
+You can also run a single test case by specifying the function name:
+
+```
+make zjit-test ZJIT_TESTS=test_putobject
+```
+
+<details>
+
+<summary>Setting up zjit-test</summary>
ZJIT uses `cargo-nextest` for Rust unit tests instead of `cargo test`.
`cargo-nextest` runs each test in its own process, which is valuable since
@@ -44,3 +70,19 @@ Since it uses Cargo, you'll also need a `configure --enable-zjit=dev ...` build
for `make zjit-test`. Since the tests need to link against CRuby, directly
calling `cargo test`, or `cargo nextest` likely won't build. Make sure to
use `make`.
+
+</details>
+
+### test/ruby/test\_zjit.rb
+
+This command runs Ruby execution tests.
+
+```
+make test-all TESTS="test/ruby/test_zjit.rb"
+```
+
+You can also run a single test case by matching the method name:
+
+```
+make test-all TESTS="test/ruby/test_zjit.rb -n test_putobject"
+```