Refactor crypto tests#5593
Open
bugadani wants to merge 2 commits into
Open
Conversation
|
New commits in main have made this PR unmergeable. Please resolve the conflicts. |
4e909ce to
bef52eb
Compare
bef52eb to
adff32f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the crypto HIL tests to better separate concerns between “direct driver” tests and work-queue/back-end tests, reducing per-test boilerplate and removing ad-hoc peripheral acquisition in favor of module #[init] contexts.
Changes:
- Refactored SHA tests by hoisting shared helpers to module scope and splitting SHA work-queue tests into a dedicated
work_queue_testsmodule with its ownContext. - Refactored AES tests by splitting work-queue CPU tests into
work_queue_tests(with an embedded-test executor for async coverage) and DMA work-queue tests intowork_queue_dma_tests(gated by#[cfg(aes_dma)]). - Replaced
unsafe { peripherals::...::steal() }patterns in work-queue tests with safe peripheral ownership viaesp_hal::init(...)in module#[init].
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
hil-test/src/bin/crypto/sha.rs |
Moves common SHA test helpers to module scope and splits work-queue SHA backend tests into a separate embedded-test module with a proper init context. |
hil-test/src/bin/crypto/aes.rs |
Splits AES work-queue tests into CPU/async and DMA-specific embedded-test modules, each with an init context to own the backend(s). |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Splits classic/work-queue tests into separate modules, so that we can properly initialize the drivers instead of the unsafe hackery we've had before - and without the accidental refcount retention issues we've had with the previous solution.