Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
env:
DO_FEATURE_MATRIX: true
DO_SCHEMARS_TESTS: ${{matrix.rust != '1.29.0'}}
DO_ALLOC_TESTS: ${{matrix.rust != '1.29.0'}}
run: ./contrib/test.sh

Embedded:
Expand Down
11 changes: 10 additions & 1 deletion contrib/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/sh -ex

FEATURES="serde serde-std"
FEATURES="serde serde-std std"

if [ "$DO_ALLOC_TESTS" = true ]; then
FEATURES="$FEATURES alloc"
fi

# Use toolchain if explicitly specified
if [ -n "$TOOLCHAIN" ]
Expand Down Expand Up @@ -30,6 +34,11 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then
do
cargo build --all --no-default-features --features="$feature"
cargo test --all --features="$feature"
# All combos of two features
for featuretwo in ${FEATURES}; do
cargo build --all --no-default-features --features="$feature $featuretwo"
cargo test --all --features="$feature $featuretwo"
done
done

# Other combos
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#[cfg(any(test, feature="std"))] extern crate core;
#[cfg(feature="core2")] extern crate core2;
#[cfg(any(feature = "alloc"))] extern crate alloc;
#[cfg(any(feature = "std"))] use std as alloc;
#[cfg(feature = "alloc")] extern crate alloc;
#[cfg(all(not(feature = "alloc"), feature = "std"))] use std as alloc;
#[cfg(feature="serde")] pub extern crate serde;
#[cfg(all(test,feature="serde"))] extern crate serde_test;

Expand Down