-
Notifications
You must be signed in to change notification settings - Fork 31
feat(hiroz): debug-time barrier against callbacks under a lock #255
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7fb3178
feat(hiroz): debug-time barrier against callbacks under a lock
YuanYuYuan 0400746
fix(reentrancy): make GuardCount unforgeable, widen the local rustdoc…
YuanYuYuan 8194a95
fix(tests): enforce the feature requirement package-wide
YuanYuYuan 3d6bec6
fix(ci): lint hiroz-tests with its features, satisfy pre-commit rustfmt
YuanYuYuan 00190dc
fix(ci): keep rmw-zenoh-rs out of the ROS-independent test run
YuanYuYuan 00b9034
fix(ci): skip the SHM-size suite in the ROS-independent test run
YuanYuYuan 1e282f3
fix(reentrancy): stop citing a defect as the exemplar, drop invented …
YuanYuYuan a95d063
fix(reentrancy): make a GuardCount underflow loud instead of saturating
YuanYuYuan d477b09
docs(tests): correct the feature-gate comment, cut its duplication
YuanYuYuan cf4911a
docs: tighten the comments across this change
YuanYuYuan 54d5072
docs: correct the cargo fmt --all rationale, drop a stray blank line
YuanYuYuan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| //! Fails loudly when `hiroz-tests` is built without the features its suites need. | ||
| //! | ||
| //! Several suites carry a crate-level `#![cfg(feature = "ros-msgs")]`. An | ||
| //! unsatisfied crate-level `cfg` neither errors nor warns — the file compiles to | ||
| //! an empty test binary reporting `0 passed`, indistinguishable from green. | ||
| //! | ||
| //! This file is deliberately ungated, so a featureless build cannot compile it | ||
| //! away. `build.rs` covers the narrower `--test <name>` invocations that never | ||
| //! select this target. | ||
| //! | ||
| //! `hiroz-tests` therefore has no supported featureless configuration: run it as | ||
| //! `cargo test -p hiroz-tests --features ros-msgs,jazzy`, or with | ||
| //! `ros-interop,<distro>` for suites that drive a real ROS installation. | ||
| //! | ||
| //! Selection is a separate failure mode from compilation: this crate is not in | ||
| //! `default-members`, so a bare `cargo nextest run` skips it rather than | ||
| //! building it empty. `scripts/test-pure-rust.nu` names it explicitly. | ||
|
|
||
| /// Without `ros-msgs`, the gated suites are silently absent — fail instead. | ||
| #[test] | ||
| #[cfg(not(feature = "ros-msgs"))] | ||
| fn ros_msgs_gated_suites_must_not_be_silently_skipped() { | ||
| panic!( | ||
| "hiroz-tests was built without the `ros-msgs` feature.\n\ | ||
| \n\ | ||
| The suites gated on it — `cache.rs`, `subscriber_timeout.rs`, \ | ||
| `service_schema_discovery.rs`, the `z_*_example` suites and others — \ | ||
| have been compiled to empty test binaries and will report `0 passed`, \ | ||
| which reads as green. That is not a pass; it is no coverage.\n\ | ||
| \n\ | ||
| Build the crate with its features:\n\ | ||
| \n\ | ||
| cargo test -p hiroz-tests --features ros-msgs,jazzy\n\ | ||
| \n\ | ||
| Suites that additionally drive a real ROS 2 installation need \ | ||
| `--features ros-interop,<distro>` instead." | ||
| ); | ||
| } | ||
|
|
||
| /// With `ros-msgs`, record that the gate was satisfied. | ||
| /// | ||
| /// Present so the guard is visible in the test list in *both* configurations — | ||
| /// a check whose only evidence is the absence of a failure is not a check. | ||
| #[test] | ||
| #[cfg(feature = "ros-msgs")] | ||
| fn ros_msgs_gated_suites_are_compiled_in() {} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.