Skip to content
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

flipperzero: Enable Miri to start running the tests #123

Merged
merged 2 commits into from
May 30, 2024
Merged

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Dec 20, 2023

It doesn't successfully run the tests because Miri doesn't yet support FFI, but these changes enable the following command to actually start:

MIRI_NO_STD=1 cargo miri test --target thumbv7em-none-eabihf

Part of #100.

@JarvisCraft JarvisCraft self-requested a review December 21, 2023 13:04
crates/sys/src/lib.rs Outdated Show resolved Hide resolved
crates/test/macros/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines 144 to 147
#[cfg(all(test, miri))]
#[start]
fn main(argc: isize, argv: *const *const u8) -> isize {
let ret = __test_runner::main(::core::ptr::null_mut());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, let's add unsafe and the contract for the pointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be unsafe fn, as it is required to exactly match the expected type of the #[start] function.

crates/test/macros/src/lib.rs Outdated Show resolved Hide resolved
@JarvisCraft JarvisCraft added the enhancement New feature or request label Dec 21, 2023
@str4d
Copy link
Contributor Author

str4d commented Dec 26, 2023

Rebased on main.

@str4d
Copy link
Contributor Author

str4d commented Dec 27, 2023

Force-pushed to address comments.

@str4d str4d changed the base branch from main to safe-entry December 27, 2023 00:54
@str4d str4d deleted the branch main December 27, 2023 09:05
@str4d str4d closed this Dec 27, 2023
@str4d str4d reopened this Dec 27, 2023
@str4d str4d changed the base branch from safe-entry to main December 27, 2023 09:06
crates/sys/src/lib.rs Outdated Show resolved Hide resolved
It doesn't *successfully* run the tests because Miri doesn't yet support
FFI, but these changes enable the following command to actually start:

    MIRI_NO_STD=1 cargo miri test --target thumbv7em-none-eabihf

Part of #100.
@str4d
Copy link
Contributor Author

str4d commented Apr 18, 2024

Rebased on current main.

@str4d
Copy link
Contributor Author

str4d commented Apr 18, 2024

Pushed a commit to switch to latest nightly for stabilised cfg_target_abi (and fix resulting Clippy lints).

@str4d str4d dismissed JarvisCraft’s stale review May 30, 2024 14:31

Review comment addressed.

@str4d str4d merged commit 686b027 into main May 30, 2024
9 checks passed
@str4d str4d deleted the basic-miri-support branch May 30, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants