Skip to content

Commit

Permalink
test(lib): fix tests with more feature combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung authored and seanmonstar committed Apr 21, 2022
1 parent ffbf610 commit 8834d5a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/body/to_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::HttpBody;
/// # Example
///
/// ```
/// # #[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))]
/// # #[cfg(all(feature = "client", feature = "tcp", any(feature = "http1", feature = "http2")))]
/// # async fn doc() -> hyper::Result<()> {
/// use hyper::{body::HttpBody};
///
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![deny(missing_debug_implementations)]
#![cfg_attr(test, deny(rust_2018_idioms))]
#![cfg_attr(all(test, feature = "full"), deny(unreachable_pub))]
#![cfg_attr(test, deny(warnings))]
#![cfg_attr(all(test, feature = "full"), deny(warnings))]
#![cfg_attr(all(test, feature = "nightly"), feature(test))]
#![cfg_attr(docsrs, feature(doc_cfg))]

Expand Down
3 changes: 3 additions & 0 deletions src/proto/h1/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down
48 changes: 48 additions & 0 deletions src/proto/h1/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1474,8 +1474,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut method,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down Expand Up @@ -1504,8 +1507,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(crate::Method::GET),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand All @@ -1529,8 +1535,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand All @@ -1552,8 +1561,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(crate::Method::GET),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: true,
Expand All @@ -1577,8 +1589,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(crate::Method::GET),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down Expand Up @@ -1606,8 +1621,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(crate::Method::GET),
h1_parser_config,
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand All @@ -1632,8 +1650,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(crate::Method::GET),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand All @@ -1653,8 +1674,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: true,
h09_responses: false,
Expand Down Expand Up @@ -1695,8 +1719,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand All @@ -1718,8 +1745,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down Expand Up @@ -1950,8 +1980,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(Method::GET),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand All @@ -1973,8 +2006,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(m),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand All @@ -1996,8 +2032,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(Method::GET),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down Expand Up @@ -2496,8 +2535,11 @@ mod tests {
cached_headers: &mut None,
req_method: &mut Some(Method::GET),
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down Expand Up @@ -2583,8 +2625,11 @@ mod tests {
cached_headers: &mut headers,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down Expand Up @@ -2626,8 +2671,11 @@ mod tests {
cached_headers: &mut headers,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "runtime")]
h1_header_read_timeout: None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_fut: &mut None,
#[cfg(feature = "runtime")]
h1_header_read_timeout_running: &mut false,
preserve_header_case: false,
h09_responses: false,
Expand Down
1 change: 1 addition & 0 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
//! use std::net::SocketAddr;
//! use hyper::{Body, Request, Response, Server};
//! use hyper::service::{make_service_fn, service_fn};
//! # #[cfg(feature = "runtime")]
//! use hyper::server::conn::AddrStream;
//!
//! #[derive(Clone)]
Expand Down

0 comments on commit 8834d5a

Please sign in to comment.