From 58ed58e4a307aab09097094a9fad9a551b13539c Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Mon, 1 Jan 2024 21:29:10 +0800 Subject: [PATCH] chore(ci): add sync tests into ci --- .github/workflows/CI.yml | 5 +++-- Cargo.toml | 15 +++++++++++++++ tests/tiny-body.rs | 2 -- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d2592d3..935f6a1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,7 +28,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly - - run: cargo test --all --verbose + - run: cargo test --test form-data --test hyper-body + - run: cargo test --test tiny-body --features="sync" --no-default-features clippy: name: Clippy @@ -44,7 +45,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - run: cargo fmt --all -- --check + - run: cargo fmt --all-features -- --check docs: name: Doc diff --git a/Cargo.toml b/Cargo.toml index 3a6b8d6..e7e6ec5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,3 +66,18 @@ path = "examples/hyper.rs" name = "tiny_http" path = "examples/tiny_http.rs" required-features = ["sync"] + +[[test]] +name = "form-data" +path = "tests/form-data.rs" +required-features = ["async"] + +[[test]] +name = "hyper-body" +path = "tests/hyper-body.rs" +required-features = ["async"] + +[[test]] +name = "tiny-body" +path = "tests/tiny-body.rs" +required-features = ["sync"] diff --git a/tests/tiny-body.rs b/tests/tiny-body.rs index c672b90..5163ea7 100644 --- a/tests/tiny-body.rs +++ b/tests/tiny-body.rs @@ -3,8 +3,6 @@ //! RUST_LOG=trace cargo test --test tiny-body --no-default-features --features="sync" -- --nocapture //! ``` -#![cfg(feature = "sync")] - use std::{fs::File, io::Read, str::FromStr}; use anyhow::Result;