| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Introduce a runtime_test macro and runtime helpers so tests run on tokio, compio, and smol instead of only tokio.
| Back | FazBrowse Home | New Git URL |
Summary
Related to #154
Design Notes
The #[runtime_test] macro expands each annotated async function into an ordinary test for every matching runtime and injects a statically bound runtime alias into the test body. A shared runtime abstraction normalizes task spawning, thread-local execution, detached tasks, join errors, yielding, sleeping, and timeouts while preserving each executor’s scheduling model. The only(...) and require(...) arguments allow tests to target individual runtimes or declare required capabilities without introducing runtime-specific logic into the test itself.
Existing mutex and semaphore tests now use these normalized operations, with deterministic yielding replacing executor-specific timing where possible. Compio is constrained to the latest release series compatible with Rust 1.86, and its join behavior is adapted to the common harness interface. The semaphore coverage also uses the existing reduce_permits API to validate permit reduction and pending acquisition behavior consistently across all three runtimes.
Testing
All commands completed successfully.