From 29fd8b55fb12833e52060a915d443881140d1c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Mon, 13 Jan 2020 01:17:56 -0500 Subject: [PATCH] Keep dummies in default features for convenience. (#1212) --- .azure/azure-pipelines.yml | 8 ++++---- Cargo.lock | 1 + Cargo.toml | 13 +++++++------ crates/nu-test-support/Cargo.toml | 3 +++ crates/nu-test-support/build.rs | 3 +++ crates/nu-test-support/src/{bin => dummies}/chop.rs | 0 .../nu-test-support/src/{bin => dummies}/cococo.rs | 0 crates/nu-test-support/src/{bin => dummies}/fail.rs | 0 8 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 crates/nu-test-support/build.rs rename crates/nu-test-support/src/{bin => dummies}/chop.rs (100%) rename crates/nu-test-support/src/{bin => dummies}/cococo.rs (100%) rename crates/nu-test-support/src/{bin => dummies}/fail.rs (100%) diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml index 59f0ee58fd..fb58390aa5 100644 --- a/.azure/azure-pipelines.yml +++ b/.azure/azure-pipelines.yml @@ -42,16 +42,16 @@ steps: echo "##vso[task.prependpath]$HOME/.cargo/bin" rustup component add rustfmt --toolchain "stable" displayName: Install Rust - - bash: RUSTFLAGS="-D warnings" cargo test --all --features=stable,nu-dummies + - bash: RUSTFLAGS="-D warnings" cargo test --all --features=stable condition: eq(variables['style'], 'unflagged') displayName: Run tests - - bash: RUSTFLAGS="-D warnings" cargo clippy --all --features=stable,nu-dummies -- -D clippy::result_unwrap_used -D clippy::option_unwrap_used + - bash: RUSTFLAGS="-D warnings" cargo clippy --all --features=stable -- -D clippy::result_unwrap_used -D clippy::option_unwrap_used condition: eq(variables['style'], 'unflagged') displayName: Check clippy lints - - bash: NUSHELL_ENABLE_ALL_FLAGS=1 RUSTFLAGS="-D warnings" cargo test --all --features=stable,nu-dummies + - bash: NUSHELL_ENABLE_ALL_FLAGS=1 RUSTFLAGS="-D warnings" cargo test --all --features=stable condition: eq(variables['style'], 'canary') displayName: Run tests - - bash: NUSHELL_ENABLE_ALL_FLAGS=1 RUSTFLAGS="-D warnings" cargo clippy --all --features=stable,nu-dummies -- -D clippy::result_unwrap_used -D clippy::option_unwrap_used + - bash: NUSHELL_ENABLE_ALL_FLAGS=1 RUSTFLAGS="-D warnings" cargo clippy --all --features=stable -- -D clippy::result_unwrap_used -D clippy::option_unwrap_used condition: eq(variables['style'], 'canary') displayName: Check clippy lints - bash: cargo fmt --all -- --check diff --git a/Cargo.lock b/Cargo.lock index 4dd0de6d55..f990bf8b5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2346,6 +2346,7 @@ dependencies = [ "dunce", "getset", "glob", + "nu-build", "tempfile", ] diff --git a/Cargo.toml b/Cargo.toml index cee23204b3..33bc8888ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -139,11 +139,12 @@ url = {version = "2.1.0", optional = true} users = "0.9" [features] -default = ["sys", "ps", "textview", "inc", "str"] -stable = ["sys", "ps", "textview", "inc", "str", "starship-prompt", "binaryview", "match", "tree", "average", "sum", "post", "fetch", "clipboard"] - +# Dummy executables nu-dummies = [] +default = ["nu-dummies", "sys", "ps", "textview", "inc", "str"] +stable = ["default", "starship-prompt", "binaryview", "match", "tree", "average", "sum", "post", "fetch", "clipboard"] + # Default sys = ["heim", "battery"] ps = ["heim", "futures-timer"] @@ -182,17 +183,17 @@ path = "src/lib.rs" [[bin]] name = "fail" -path = "crates/nu-test-support/src/bin/fail.rs" +path = "crates/nu-test-support/src/dummies/fail.rs" required-features = ["nu-dummies"] [[bin]] name = "chop" -path = "crates/nu-test-support/src/bin/chop.rs" +path = "crates/nu-test-support/src/dummies/chop.rs" required-features = ["nu-dummies"] [[bin]] name = "cococo" -path = "crates/nu-test-support/src/bin/cococo.rs" +path = "crates/nu-test-support/src/dummies/cococo.rs" required-features = ["nu-dummies"] # Core plugins that ship with `cargo install nu` by default diff --git a/crates/nu-test-support/Cargo.toml b/crates/nu-test-support/Cargo.toml index c282064a03..1d4a77e086 100644 --- a/crates/nu-test-support/Cargo.toml +++ b/crates/nu-test-support/Cargo.toml @@ -15,3 +15,6 @@ dunce = "1.0.0" getset = "0.0.9" glob = "0.3.0" tempfile = "3.1.0" + +[build-dependencies] +nu-build = { version = "0.8.0", path = "../nu-build" } diff --git a/crates/nu-test-support/build.rs b/crates/nu-test-support/build.rs new file mode 100644 index 0000000000..b7511cfc6a --- /dev/null +++ b/crates/nu-test-support/build.rs @@ -0,0 +1,3 @@ +fn main() -> Result<(), Box> { + nu_build::build() +} diff --git a/crates/nu-test-support/src/bin/chop.rs b/crates/nu-test-support/src/dummies/chop.rs similarity index 100% rename from crates/nu-test-support/src/bin/chop.rs rename to crates/nu-test-support/src/dummies/chop.rs diff --git a/crates/nu-test-support/src/bin/cococo.rs b/crates/nu-test-support/src/dummies/cococo.rs similarity index 100% rename from crates/nu-test-support/src/bin/cococo.rs rename to crates/nu-test-support/src/dummies/cococo.rs diff --git a/crates/nu-test-support/src/bin/fail.rs b/crates/nu-test-support/src/dummies/fail.rs similarity index 100% rename from crates/nu-test-support/src/bin/fail.rs rename to crates/nu-test-support/src/dummies/fail.rs