Skip to content

Build serde without default features #129

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

Merged
merged 1 commit into from
Jun 9, 2020
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
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ script:
if [ -z "$SKIP_TEST" ]; then
cargo test --verbose --features "$FEATURES" &&
cargo test --release --verbose --features "$FEATURES"
if [ "$FEATURES" = "serde-1" ]; then
cargo test --verbose -p test-serde &&
cargo test --release --verbose -p test-serde
fi
fi &&
if [ -n "$TEST_BENCH" ]; then
cargo test -v --benches --no-run --features "$FEATURES"
Expand Down
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bench = false
[build-dependencies]
autocfg = "1"
[dependencies]
serde = { version = "1.0", optional = true }
serde = { version = "1.0", optional = true, default-features = false }
rayon = { version = "1.0", optional = true }

[dev-dependencies]
Expand All @@ -41,7 +41,6 @@ rand = {version = "0.7", features = ["small_rng"] }
quickcheck = { version = "0.9", default-features = false }
fnv = "1.0"
lazy_static = "1.3"
serde_test = "1.0.99"

[features]
# Serialization with serde 1.0
Expand All @@ -62,4 +61,4 @@ tag-name = "{{version}}"
features = ["serde-1", "rayon"]

[workspace]
members = ["test-nostd"]
members = ["test-nostd", "test-serde"]
2 changes: 1 addition & 1 deletion test-nostd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false
edition = "2018"

[dependencies]
indexmap = { path = ".." }
indexmap = { path = "..", features = ["serde-1"] }
# no-std compatible hasher
twox-hash = { version = "1.5", default-features = false }

Expand Down
13 changes: 13 additions & 0 deletions test-serde/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "test-serde"
version = "0.1.0"
authors = ["bluss"]
publish = false
edition = "2018"

[dependencies]

[dev-dependencies]
fnv = "1.0"
indexmap = { path = "..", features = ["serde-1"] }
serde_test = "1.0.99"
2 changes: 1 addition & 1 deletion tests/serde.rs → test-serde/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "serde-1")]
#![cfg(test)]

#[macro_use]
extern crate indexmap;
Expand Down