Remove h2-test-support crate (#119)
The h2-test-support caused the unstable flag to always be enabled.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn handshake() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#[macro_use]
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
use std::error::Error;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#[macro_use]
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
// In this case, the stream & connection both have capacity, but capacity is not
|
||||
// explicitly requested.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#[macro_use]
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn recv_single_ping() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#[macro_use]
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn single_stream_send_large_body() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn recv_push_works() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
const SETTINGS: &'static [u8] = &[0, 0, 0, 4, 0, 0, 0, 0, 0];
|
||||
const SETTINGS_ACK: &'static [u8] = &[0, 0, 0, 4, 1, 0, 0, 0, 0];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn send_recv_headers_only() {
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
[package]
|
||||
name = "h2-test-support"
|
||||
version = "0.1.0"
|
||||
authors = ["Carl Lerche <me@carllerche.com>"]
|
||||
|
||||
[dependencies]
|
||||
futures = "0.1"
|
||||
tokio-io = "0.1"
|
||||
bytes = "0.4"
|
||||
http = { git = "https://github.com/carllerche/http" }
|
||||
env_logger = "0.4"
|
||||
|
||||
mock-io = { git = "https://github.com/carllerche/mock-io", branch = "experiments" }
|
||||
|
||||
[dependencies.h2]
|
||||
path = "../.."
|
||||
features = ["unstable"]
|
||||
@@ -1,3 +0,0 @@
|
||||
**This is not a real crate**
|
||||
|
||||
You should not use this crate, it only exists to work around cargo limitations.
|
||||
58
tests/support/mod.rs
Normal file
58
tests/support/mod.rs
Normal file
@@ -0,0 +1,58 @@
|
||||
//! Utilities to support tests.
|
||||
|
||||
pub extern crate bytes;
|
||||
pub extern crate env_logger;
|
||||
pub extern crate futures;
|
||||
pub extern crate h2;
|
||||
pub extern crate http;
|
||||
pub extern crate mock_io;
|
||||
pub extern crate tokio_io;
|
||||
|
||||
// Kind of annoying, but we can't use macros from crates that aren't specified
|
||||
// at the root.
|
||||
macro_rules! try_ready {
|
||||
($e:expr) => ({
|
||||
use $crate::support::futures::Async;
|
||||
match $e {
|
||||
Ok(Async::Ready(t)) => t,
|
||||
Ok(Async::NotReady) => return Ok(Async::NotReady),
|
||||
Err(e) => return Err(From::from(e)),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
macro_rules! try_nb {
|
||||
($e:expr) => ({
|
||||
use $crate::support::futures::Async;
|
||||
use ::std::io::ErrorKind::WouldBlock;
|
||||
|
||||
match $e {
|
||||
Ok(t) => t,
|
||||
Err(ref e) if e.kind() == WouldBlock => {
|
||||
return Ok(Async::NotReady)
|
||||
}
|
||||
Err(e) => return Err(e.into()),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[macro_use]
|
||||
mod assert;
|
||||
|
||||
#[macro_use]
|
||||
pub mod raw;
|
||||
|
||||
pub mod frames;
|
||||
pub mod prelude;
|
||||
pub mod mock;
|
||||
pub mod util;
|
||||
|
||||
mod future_ext;
|
||||
|
||||
pub use self::future_ext::{FutureExt, Unwrap};
|
||||
|
||||
// This is our test Codec type
|
||||
pub type Codec<T> = h2::Codec<T, ::std::io::Cursor<::bytes::Bytes>>;
|
||||
|
||||
// This is the frame type that is sent
|
||||
pub type SendFrame = h2::frame::Frame<::std::io::Cursor<::bytes::Bytes>>;
|
||||
@@ -26,7 +26,7 @@ pub use super::{bytes, env_logger, futures, http, mock_io, tokio_io};
|
||||
pub use self::futures::{Future, Sink, Stream};
|
||||
|
||||
// And our Future extensions
|
||||
pub use future_ext::{FutureExt, Unwrap};
|
||||
pub use super::future_ext::{FutureExt, Unwrap};
|
||||
|
||||
// Re-export HTTP types
|
||||
pub use self::http::{HeaderMap, Method, Request, Response, StatusCode};
|
||||
@@ -7,19 +7,19 @@ macro_rules! raw_codec {
|
||||
$fn:ident => [$($chunk:expr,)+];
|
||||
)*
|
||||
) => {{
|
||||
let mut b = $crate::mock_io::Builder::new();
|
||||
let mut b = $crate::support::mock_io::Builder::new();
|
||||
|
||||
$({
|
||||
let mut chunk = vec![];
|
||||
|
||||
$(
|
||||
$crate::raw::Chunk::push(&$chunk, &mut chunk);
|
||||
$crate::support::raw::Chunk::push(&$chunk, &mut chunk);
|
||||
)+
|
||||
|
||||
b.$fn(&chunk[..]);
|
||||
})*
|
||||
|
||||
$crate::Codec::new(b.build())
|
||||
$crate::support::Codec::new(b.build())
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
//! Utilities to support tests.
|
||||
|
||||
pub extern crate bytes;
|
||||
pub extern crate h2;
|
||||
pub extern crate http;
|
||||
|
||||
#[macro_use]
|
||||
pub extern crate tokio_io;
|
||||
|
||||
pub extern crate env_logger;
|
||||
#[macro_use]
|
||||
pub extern crate futures;
|
||||
pub extern crate mock_io;
|
||||
|
||||
#[macro_use]
|
||||
mod assert;
|
||||
|
||||
#[macro_use]
|
||||
pub mod raw;
|
||||
|
||||
pub mod frames;
|
||||
pub mod prelude;
|
||||
pub mod mock;
|
||||
pub mod util;
|
||||
|
||||
mod future_ext;
|
||||
|
||||
pub use future_ext::{FutureExt, Unwrap};
|
||||
|
||||
// This is our test Codec type
|
||||
pub type Codec<T> = h2::Codec<T, ::std::io::Cursor<::bytes::Bytes>>;
|
||||
|
||||
// This is the frame type that is sent
|
||||
pub type SendFrame = h2::frame::Frame<::std::io::Cursor<::bytes::Bytes>>;
|
||||
@@ -1,8 +1,8 @@
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
extern crate h2_test_support;
|
||||
use h2_test_support::prelude::*;
|
||||
pub mod support;
|
||||
use support::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn recv_trailers_only() {
|
||||
|
||||
Reference in New Issue
Block a user