From 5c367901874971dc57543ba7c43c54cb81f91000 Mon Sep 17 00:00:00 2001 From: Timon Date: Thu, 31 Oct 2019 20:54:14 +0100 Subject: [PATCH] Fixed screen feature flag and updated CI script (#302) --- .github/workflows/crossterm_test.yml | 12 ++++++------ .travis.yml | 12 ++++++------ Cargo.toml | 2 +- src/crossterm.rs | 1 + 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/crossterm_test.yml b/.github/workflows/crossterm_test.yml index 8caf684..1bf35e3 100644 --- a/.github/workflows/crossterm_test.yml +++ b/.github/workflows/crossterm_test.yml @@ -48,22 +48,22 @@ jobs: run: cargo build continue-on-error: ${{ matrix.can-fail }} - name: Test all features - run: cargo test --all-features -- --nocapture --test-threads 1 + run: cargo test --all-features --no-default-features -- --nocapture --test-threads 1 continue-on-error: ${{ matrix.can-fail }} - name: Test cursor Feature - run: cargo test --features cursor -- --nocapture --test-threads 1 + run: cargo test --features cursor --no-default-features --lib -- --nocapture --test-threads 1 continue-on-error: ${{ matrix.can-fail }} - name: Test style Feature - run: cargo test --features style -- --nocapture --test-threads 1 + run: cargo test --features style --no-default-features --lib -- --nocapture --test-threads 1 continue-on-error: ${{ matrix.can-fail }} - name: Test terminal Feature - run: cargo test --features terminal -- --nocapture --test-threads 1 + run: cargo test --features terminal --no-default-features --lib -- --nocapture --test-threads 1 continue-on-error: ${{ matrix.can-fail }} - name: Test screen Feature - run: cargo test --features screen -- --nocapture --test-threads 1 + run: cargo test --features screen --no-default-features --lib -- --nocapture --test-threads 1 continue-on-error: ${{ matrix.can-fail }} - name: Test input Feature - run: cargo test --features input -- --nocapture --test-threads 1 + run: cargo test --features input --no-default-features --lib -- --nocapture --test-threads 1 continue-on-error: ${{ matrix.can-fail }} - name: Test Packaging if: matrix.rust == 'stable' diff --git a/.travis.yml b/.travis.yml index 8336f6f..248defe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,9 +33,9 @@ script: - rustc --version - if [ "$TRAVIS_RUST_VERSION" = "stable" ]; then cargo fmt --all -- --check; fi - cargo build - - cargo test --all-features -- --nocapture --test-threads 1 - - cargo test --features cursor -- --nocapture --test-threads 1 - - cargo test --features style -- --nocapture --test-threads 1 - - cargo test --features terminal -- --nocapture --test-threads 1 - - cargo test --features screen -- --nocapture --test-threads 1 - - cargo test --features input -- --nocapture --test-threads 1 + - cargo test --all-features --no-default-features -- --nocapture --test-threads 1 + - cargo test --features cursor --no-default-features --lib -- --nocapture --test-threads 1 + - cargo test --features style --no-default-features --lib -- --nocapture --test-threads 1 + - cargo test --features terminal --no-default-features --lib -- --nocapture --test-threads 1 + - cargo test --features screen --no-default-features --lib -- --nocapture --test-threads 1 + - cargo test --features input --no-default-features --lib -- --nocapture --test-threads 1 diff --git a/Cargo.toml b/Cargo.toml index 115c419..df1546a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ default = ["cursor", "style", "terminal", "screen", "input"] cursor = ["lazy_static", "input", "winapi/wincon", "winapi/winnt", "winapi/minwindef"] style = ["lazy_static", "winapi/wincon"] terminal = ["cursor"] -screen = ["winapi/wincon", "winapi/minwindef"] +screen = ["lazy_static", "winapi/wincon", "winapi/minwindef"] input = ["mio", "lazy_static", "screen", "winapi/winnt", "winapi/winuser"] [dependencies] diff --git a/src/crossterm.rs b/src/crossterm.rs index 12eb8f4..b55da1f 100644 --- a/src/crossterm.rs +++ b/src/crossterm.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "style")] use std::fmt::Display; // TODO Should be removed? This adds just another way to achieve the same thing.