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

gate tests behind the features they use #944

Merged
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
5 changes: 4 additions & 1 deletion x11rb-protocol/src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ use core::fmt;
/// to establish an X11 connection like so:
///
/// ```rust,no_run
/// # #[cfg(feature = "std")]
/// # {
/// # use x11rb_protocol::connect::Connect;
/// # use x11rb_protocol::xauth::Family;
/// # use std::{error::Error, io::prelude::*};
Expand Down Expand Up @@ -86,6 +88,7 @@ use core::fmt;
/// let setup = connect.into_setup()?;
/// # Ok(())
/// # }
/// # }
/// ```
///
/// If, instead, `stream` implements `AsyncRead` and `AsyncWrite`, the code
Expand Down Expand Up @@ -262,7 +265,7 @@ impl TryFrom<Connect> for Setup {
}

#[cfg(test)]
#[cfg(feature = "extra-traits")]
#[cfg(all(feature = "extra-traits", feature = "std"))]
mod tests {
use super::Connect;
use crate::errors::ConnectError;
Expand Down
2 changes: 1 addition & 1 deletion x11rb-protocol/src/packet_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn extra_length(buffer: &[u8]) -> usize {
}
}

#[cfg(test)]
#[cfg(all(test, feature = "std"))]
mod tests {
use super::PacketReader;
use alloc::{vec, vec::Vec};
Expand Down
2 changes: 1 addition & 1 deletion x11rb-protocol/src/parse_display/connect_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(super) fn connect_addresses(p: &ParsedDisplay) -> impl Iterator<Item = Conne
targets.into_iter()
}

#[cfg(test)]
#[cfg(all(test, feature = "std"))]
mod tests {
// make sure iterator properties are clean
use super::{super::parse_display, ConnectAddress};
Expand Down
2 changes: 1 addition & 1 deletion x11rb-protocol/src/parse_display/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn parse_display_direct_path(
))
}

#[cfg(test)]
#[cfg(all(test, feature = "std"))]
mod test {
use super::{
parse_display, parse_display_with_file_exists_callback, DisplayParsingError, ParsedDisplay,
Expand Down
1 change: 1 addition & 0 deletions x11rb-protocol/src/test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(feature = "std")]
use std::borrow::Cow;

use crate::protocol::{get_request_name, request_name};
Expand Down
2 changes: 1 addition & 1 deletion x11rb-protocol/src/x11_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ implement_serialize!(i64: 8);
forward_float!(f32: u32);
forward_float!(f64: u64);

#[cfg(test)]
#[cfg(all(test, feature = "std"))]
mod float_tests {
use super::{Serialize, TryParse};

Expand Down
Loading