From 1633acc4b58894d06d568abf7cf6897e2186cff3 Mon Sep 17 00:00:00 2001 From: kenoss Date: Sat, 5 Oct 2024 23:37:43 +0900 Subject: [PATCH] test: Prevent CI failure due to dependencies --- .github/workflows/ci.yaml | 2 +- Cargo.toml | 1 + justfile | 5 ++++- tests/test.rs | 5 +++++ tests/ui/{ => smithay}/pass_real_world_example.rs | 0 5 files changed, 11 insertions(+), 2 deletions(-) rename tests/ui/{ => smithay}/pass_real_world_example.rs (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c49dc15..888edd1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,7 @@ jobs: crate: just version: '1.34.0' - - run: just test + - run: just test-ci check-strict: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index b58d83d..2471b35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ proc-macro = true [features] default = [] +test_smithay = [] [[test]] name = "tests" diff --git a/justfile b/justfile index e27af3e..7166f8d 100644 --- a/justfile +++ b/justfile @@ -11,7 +11,10 @@ run *ARGS: cargo run {{ARGS}} test *ARGS: + cargo test --features test_smithay {{ARGS}} + +test-ci *ARGS: cargo test {{ARGS}} nextest-run *ARGS: - cargo nextest run {{ARGS}} + cargo nextest run --features test_smithay {{ARGS}} diff --git a/tests/test.rs b/tests/test.rs index 276d591..cd2c62c 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -3,4 +3,9 @@ fn ui_test() { let t = trybuild::TestCases::new(); t.pass("tests/ui/pass_*.rs"); t.compile_fail("tests/ui/fail*.rs"); + #[cfg(feature = "test_smithay")] + { + t.pass("tests/ui/smithay/pass_*.rs"); + t.compile_fail("tests/ui/smithay/fail*.rs"); + } } diff --git a/tests/ui/pass_real_world_example.rs b/tests/ui/smithay/pass_real_world_example.rs similarity index 100% rename from tests/ui/pass_real_world_example.rs rename to tests/ui/smithay/pass_real_world_example.rs