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

Run all tests in no_std environments if std feature is disabled #269

Merged
merged 13 commits into from
Jul 5, 2023

Conversation

JelteF
Copy link
Owner

@JelteF JelteF commented Jul 3, 2023

Synopsis

This adds the following line to all of our test files.

 #![cfg_attr(not(feature = "std"), no_std)]

This way we test that all our features also work in no_std environments.

Checklist

  • Documentation is updated (if required)
  • Tests are added/updated (if required)
  • CHANGELOG entry is added (if required)

JelteF and others added 11 commits July 1, 2023 18:26
The `Error` derive can be made to work well for the most part in
`no_std` environments by enabling `#![feature(error_in_core)]`. This
changes the `Error` derive slightly to import `Error` and related
traits from core, when the `std` feature is disabled.

Fixes #261
This adds the following line to all of our test files.
```rust
 #![cfg_attr(not(feature = "std"), no_std)]
```

This way we test that all our features also work in no_std environments.
@JelteF JelteF requested a review from tyranron July 3, 2023 21:21
@JelteF JelteF self-assigned this Jul 3, 2023
@JelteF JelteF changed the title Support Error in no_std environments Run all tests in no_std environments if std feature is disabled Jul 3, 2023
Base automatically changed from error-in-no_std to master July 5, 2023 11:35
@tyranron tyranron added this to the 1.0.0 milestone Jul 5, 2023
Copy link
Collaborator

@tyranron tyranron left a comment

Choose a reason for hiding this comment

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

@JelteF I've edited imports in tests a bit to remove warnings in std/no_std.

@tyranron tyranron merged commit ae5b263 into master Jul 5, 2023
16 checks passed
@tyranron tyranron deleted the no_std-tests branch July 5, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants