Skip to content

Commit

Permalink
Create workspace
Browse files Browse the repository at this point in the history
This allows us to have a proper place for our test-harness.
  • Loading branch information
thomaseizinger committed Nov 3, 2022
1 parent 3941cdc commit a0ba23b
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 46 deletions.
35 changes: 2 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,2 @@
[package]
name = "yamux"
version = "0.10.2"
authors = ["Parity Technologies <admin@parity.io>"]
license = "Apache-2.0 OR MIT"
description = "Multiplexer over reliable, ordered connections"
keywords = ["network", "protocol"]
categories = ["network-programming"]
repository = "https://github.com/paritytech/yamux"
readme = "README.md"
edition = "2018"

[dependencies]
futures = { version = "0.3.12", default-features = false, features = ["std"] }
log = "0.4.8"
nohash-hasher = "0.2"
parking_lot = "0.12"
rand = "0.8.3"
static_assertions = "1"

[dev-dependencies]
anyhow = "1"
criterion = "0.4"
env_logger = "0.9"
futures = "0.3.4"
quickcheck = "1.0"
tokio = { version = "1.0", features = ["net", "rt-multi-thread", "macros", "time"] }
tokio-util = { version = "0.7", features = ["compat"] }
constrained-connection = "0.1"

[[bench]]
name = "concurrent"
harness = false
[workspace]
members = ["yamux", "test-harness"]
19 changes: 19 additions & 0 deletions test-harness/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "test-harness"
version = "0.1.0"
edition = "2018"
publish = false

[dependencies]
yamux = { path = "../yamux" }
futures = "0.3.4"
quickcheck = "1.0"
tokio = { version = "1.0", features = ["net", "rt-multi-thread", "macros", "time"] }
tokio-util = { version = "0.7", features = ["compat"] }
anyhow = "1"
log = "0.4.17"

[dev-dependencies]
env_logger = "0.9"
constrained-connection = "0.1"

File renamed without changes.
5 changes: 1 addition & 4 deletions tests/concurrent.rs → test-harness/tests/concurrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@
// at https://www.apache.org/licenses/LICENSE-2.0 and a copy of the MIT license
// at https://opensource.org/licenses/MIT.

#[allow(dead_code)]
mod harness;

use futures::prelude::*;
use futures::stream::FuturesUnordered;
use harness::*;
use quickcheck::{Arbitrary, Gen, QuickCheck};
use std::{
io,
net::{Ipv4Addr, SocketAddr, SocketAddrV4},
};
use test_harness::*;
use tokio::net::{TcpListener, TcpStream};
use tokio::{net::TcpSocket, runtime::Runtime, task};
use tokio_util::compat::{Compat, TokioAsyncReadCompatExt};
Expand Down
5 changes: 1 addition & 4 deletions tests/poll_api.rs → test-harness/tests/poll_api.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#[allow(dead_code)]
mod harness;

use futures::future::BoxFuture;
use futures::stream::FuturesUnordered;
use futures::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, FutureExt, StreamExt};
use harness::*;
use quickcheck::QuickCheck;
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use test_harness::*;
use tokio::net::TcpStream;
use tokio::runtime::Runtime;
use tokio_util::compat::TokioAsyncReadCompatExt;
Expand Down
6 changes: 1 addition & 5 deletions tests/tests.rs → test-harness/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,18 @@
// at https://www.apache.org/licenses/LICENSE-2.0 and a copy of the MIT license
// at https://opensource.org/licenses/MIT.

#[allow(dead_code)]
mod harness;

use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
use futures::executor::LocalPool;
use futures::future::join;
use futures::io::AsyncReadExt;
use futures::prelude::*;
use futures::task::{Spawn, SpawnExt};
use harness::*;
use harness::{Msg, TestConfig};
use quickcheck::{QuickCheck, TestResult};
use std::panic::panic_any;
use std::pin::Pin;
use std::sync::{Arc, Mutex};
use std::task::{Context, Poll, Waker};
use test_harness::*;
use tokio::{runtime::Runtime, task};
use yamux::{Config, Connection, ConnectionError, Control, Mode};

Expand Down
33 changes: 33 additions & 0 deletions yamux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "yamux"
version = "0.10.2"
authors = ["Parity Technologies <admin@parity.io>"]
license = "Apache-2.0 OR MIT"
description = "Multiplexer over reliable, ordered connections"
keywords = ["network", "protocol"]
categories = ["network-programming"]
repository = "https://github.com/paritytech/yamux"
readme = "README.md"
edition = "2018"

[dependencies]
futures = { version = "0.3.12", default-features = false, features = ["std"] }
log = "0.4.8"
nohash-hasher = "0.2"
parking_lot = "0.12"
rand = "0.8.3"
static_assertions = "1"

[dev-dependencies]
anyhow = "1"
criterion = "0.4"
env_logger = "0.9"
futures = "0.3.4"
quickcheck = "1.0"
tokio = { version = "1.0", features = ["net", "rt-multi-thread", "macros", "time"] }
tokio-util = { version = "0.7", features = ["compat"] }
constrained-connection = "0.1"

[[bench]]
name = "concurrent"
harness = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a0ba23b

Please sign in to comment.