Skip to content

Commit

Permalink
Test full feature separately in no_std on CI (#424, #420)
Browse files Browse the repository at this point in the history
## Synopsis

`cargo test --no-default-features --features=full` fails imposing
problems on other CIs.

## Solution

- Consider testing `full` Cargo feature in `test-features` CI job to
handle such regressions.
- Update the relevant tests to run under `no_std` too.
  • Loading branch information
tyranron authored Nov 28, 2024
1 parent 5263c72 commit 6844e63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci/test_all_features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ fi

set -euxo pipefail

for feature in $(tomljson Cargo.toml | jq --raw-output '.features | keys[]' | grep -v 'default\|std\|full\|testing-helpers'); do
for feature in $(tomljson Cargo.toml | jq --raw-output '.features | keys[]' | grep -v 'default\|std\|testing-helpers'); do
RUSTFLAGS='-D warnings' cargo +nightly test -p derive_more --tests --no-default-features --features "$feature$std,testing-helpers"
done
7 changes: 7 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(not(feature = "std"))]
#[macro_use]
extern crate alloc;

#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, string::ToString as _, vec::Vec};

use derive_more::{
Add, AddAssign, Binary, BitAnd, BitOr, BitXor, Constructor, Deref, DerefMut,
Display, Div, From, FromStr, Index, IndexMut, Into, IntoIterator, Mul, MulAssign,
Expand Down

0 comments on commit 6844e63

Please sign in to comment.