Skip to content

Commit

Permalink
no feature test added
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Nov 28, 2023
1 parent e77acb8 commit d7b0ea8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ jobs:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
ASYNC_STD_THREAD_COUNT: 4

- name: Check for feature leaks
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions-rs/cargo@v1
with:
command: nextest
args: run -p zenohd --no-default-features

- name: Run doctests
uses: actions-rs/cargo@v1
with:
Expand Down
3 changes: 2 additions & 1 deletion zenohd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["zenoh/default"]
shared-memory = ["zenoh/shared-memory"]

[dependencies]
Expand All @@ -37,7 +38,7 @@ git-version = { workspace = true }
json5 = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
zenoh = { workspace = true, default-features = true, features = ["unstable"] }
zenoh = { workspace = true, features = ["unstable"] }

[dev-dependencies]
rand = { workspace = true, features = ["default"] }
Expand Down
24 changes: 24 additions & 0 deletions zenohd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ fn config_from_args(args: &ArgMatches) -> Config {
}

#[test]
#[cfg(feature = "default")]
fn test_default_features() {
assert_eq!(zenoh::FEATURES, concat!(
" zenoh/auth_pubkey",
Expand All @@ -328,4 +329,27 @@ fn test_default_features() {
" zenoh/unstable",
" zenoh/default",
));
}

#[test]
#[cfg(not(feature = "default"))]
fn test_no_default_features() {
assert_eq!(zenoh::FEATURES, concat!(
// " zenoh/auth_pubkey",
// " zenoh/auth_usrpwd",
// " zenoh/complete_n",
// " zenoh/shared-memory",
// " zenoh/stats",
// " zenoh/transport_multilink",
// " zenoh/transport_quic",
// " zenoh/transport_serial",
// " zenoh/transport_unixpipe",
// " zenoh/transport_tcp",
// " zenoh/transport_tls",
// " zenoh/transport_udp",
// " zenoh/transport_unixsock-stream",
// " zenoh/transport_ws",
" zenoh/unstable",
// " zenoh/default",
));
}

0 comments on commit d7b0ea8

Please sign in to comment.