feat: enable inter-realm mode in 'gno run'
A new -pkgpath flag is added to gno run command in order to enable inter-realm behaviour in standalone local mode.
It allows to run inter-realm test programs under the gno debugger.
Application
Executing realm test programs with gno run doesn't work:
$ cd gnovm
$ go run ./cmd/gno run ./tests/files/zrealm_std4.gno
panic: crossing() is only allowed in realm packages [recovered]
panic: std_test/./tests/files/zrealm_std4.gno:9:2: crossing() is only allowed in realm packages:
--- preprocess stack ---
[...]
Now setting a realm identity for the main function:
$ go run ./cmd/gno run -pgkpath gnolang/r/std_test ./tests/files/zrealm_std4.gno
test1 gno.land/r/demo/tests
test2 gno.land/r/demo/tests
test3 gno.land/r/demo/tests
No panic and output is identical to test expected output:
$ cd gnovm/pkg/gnolang
$ go test -run TestFiles/zrealm_std4.gno
And now we can run the test case under the gno debugger:
$ go run ./cmd/gno run -debug -pgkpath gnolang/r/std_test ./tests/files/zrealm_std4.gno
🛠 PR Checks Summary
All Automated Checks passed. ✅
Manual Checks (for Reviewers):
- [ ] IGNORE the bot requirements for this PR (force green CI check)
Read More
🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.
✅ Automated Checks (for Contributors):
🟢 Maintainers must be able to edit this pull request (more info)
☑️ Contributor Actions:
- Fix any issues flagged by automated checks.
- Follow the Contributor Checklist to ensure your PR is ready for review.
- Add new tests, or document why they are unnecessary.
- Provide clear examples/screenshots, if necessary.
- Update documentation, if required.
- Ensure no breaking changes, or include
BREAKING CHANGEnotes. - Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
- Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)
If
🟢 Condition met └── 🟢 And ├── 🟢 The base branch matches this pattern: ^master$ └── 🟢 The pull request was created from a fork (head branch repo: mvertes/gno)Then
🟢 Requirement satisfied └── 🟢 Maintainer can modify this pull requestManual Checks
**IGNORE** the bot requirements for this PR (force green CI check)
If
🟢 Condition met └── 🟢 On every pull requestCan be checked by
- Any user with comment edit permission
Codecov Report
:x: Patch coverage is 51.11111% with 44 lines in your changes missing coverage. Please review.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| gnovm/cmd/gno/run.go | 16.32% | 40 Missing and 1 partial :warning: |
| gnovm/pkg/gnolang/debugger.go | 92.68% | 2 Missing and 1 partial :warning: |
:loudspeaker: Thoughts on this report? Let us know!