Skip to content

Commit

Permalink
move stdout capture from runtime core to dev-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed May 17, 2019
1 parent 542e47f commit 4760840
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 11 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ wasmer-emscripten = { path = "lib/emscripten" }
wasmer-llvm-backend = { path = "lib/llvm-backend", optional = true }
wasmer-wasi = { path = "lib/wasi", optional = true }
wasmer-kernel-loader = { path = "lib/kernel-loader", optional = true }
wasmer-dev-utils = { path = "lib/dev-utils", optional = true }

[workspace]
members = ["lib/clif-backend", "lib/singlepass-backend", "lib/runtime", "lib/runtime-abi", "lib/runtime-core", "lib/emscripten", "lib/spectests", "lib/win-exception-handler", "lib/runtime-c-api", "lib/llvm-backend", "lib/wasi", "lib/middleware-common", "lib/kernel-loader", "lib/kernel-net", "examples/plugin-for-example"]
members = ["lib/clif-backend", "lib/singlepass-backend", "lib/runtime", "lib/runtime-abi", "lib/runtime-core", "lib/emscripten", "lib/spectests", "lib/win-exception-handler", "lib/runtime-c-api", "lib/llvm-backend", "lib/wasi", "lib/middleware-common", "lib/kernel-loader", "lib/kernel-net", "lib/dev-utils", "examples/plugin-for-example"]

[build-dependencies]
wabt = "0.7.2"
Expand Down
11 changes: 11 additions & 0 deletions lib/dev-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "wasmer-dev-utils"
version = "0.4.2"
description = "Wasmer runtime core library"
license = "MIT"
authors = ["The Wasmer Engineering Team <[email protected]>"]
edition = "2018"
repository = "https://github.com/wasmerio/wasmer"

[dependencies]
libc = "0.2.49"
3 changes: 3 additions & 0 deletions lib/dev-utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dev Utils

This is shared code between the modules for testing and development only. Code in this crate will not be shipped.
File renamed without changes.
2 changes: 2 additions & 0 deletions lib/dev-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod file_descriptor;
pub mod stdio;
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/emscripten/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rand = "0.6"

[dev-dependencies]
wabt = "0.7.2"
wasmer-runtime-core = { path = "../runtime-core", version = "0.4.2", features = ["regression-test"] }
wasmer-dev-utils = { path = "../dev-utils", version = "0.4.2"}

[build-dependencies]
glob = "0.2.11"
Expand Down
2 changes: 1 addition & 1 deletion lib/emscripten/tests/emtests/_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ macro_rules! assert_emscripten_output {
generate_emscripten_env,
};
use wasmer_runtime_core::{
stdio::StdioCapturer,
backend::Compiler,
};
use wasmer_dev_utils::stdio::StdioCapturer;

#[cfg(feature = "clif")]
fn get_compiler() -> impl Compiler {
Expand Down
3 changes: 1 addition & 2 deletions lib/runtime-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ blake2b_simd = "0.4.1"
rustc_version = "0.2.3"

[features]
debug = []
regression-test = []
debug = []
4 changes: 0 additions & 4 deletions lib/runtime-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ pub mod cache;
pub mod codegen;
pub mod error;
pub mod export;
#[cfg(any(test, feature = "regression-test"))]
pub mod file_descriptor;
pub mod global;
pub mod import;
pub mod instance;
Expand All @@ -28,8 +26,6 @@ pub mod memory;
pub mod module;
pub mod parse;
mod sig_registry;
#[cfg(any(test, feature = "regression-test"))]
pub mod stdio;
pub mod structures;
mod sys;
pub mod table;
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ glob = "0.2.11"

[dev-dependencies]
wasmer-clif-backend = { path = "../clif-backend", version = "0.4.2" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.4.2", features = ["regression-test"] }
wasmer-dev-utils = { path = "../dev-utils", version = "0.4.2"}

[features]
clif = []
Expand Down
3 changes: 2 additions & 1 deletion lib/wasi/tests/wasitests/_common.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
macro_rules! assert_wasi_output {
($file:expr, $name:expr, $args:expr, $expected:expr) => {{
use wasmer_runtime_core::{backend::Compiler, stdio::StdioCapturer, Func};
use wasmer_dev_utils::stdio::StdioCapturer;
use wasmer_runtime_core::{backend::Compiler, Func};
use wasmer_wasi::generate_import_object;

#[cfg(feature = "clif")]
Expand Down

0 comments on commit 4760840

Please sign in to comment.