From fcd152eb38f58ab6dd1d2914863c757f952cf3c9 Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Wed, 3 Apr 2024 21:35:58 +0400 Subject: [PATCH] split `init` tests, now behind the cfg-flag --- .github/workflows/tests.yml | 13 ++++++++++--- Cargo.lock | 2 +- cargo/Cargo.toml | 2 +- cargo/tests/init/init.rs | 3 +++ cargo/tests/init/new.rs | 3 +++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 603704db..2b822954 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -248,12 +248,19 @@ jobs: # sudo apt -y install libwebkit2gtk-4.0-dev - name: Test + run: cargo test -p=cargo-playdate -- --nocapture + + - name: Test (init::) + env: + RUSTFLAGS: --cfg init_tests run: | - cargo test -p=cargo-playdate -- --nocapture ${{ runner.os == 'Windows' && '--test-threads=1' || '' }} - rm -rf ./target/tmp + cargo test -p=cargo-playdate init:: -- --nocapture ${{ runner.os == 'Windows' && '--test-threads=1' || '' }} + + - name: Clean tmp + run: rm -rf ./target/tmp # This test is flickering on GH CI 🤷🏻‍♂️ - - name: Execution + - name: Test Execution if: runner.os == 'macOS' && contains(github.event.head_commit.message, 'execution') env: RUSTFLAGS: --cfg exec_tests diff --git a/Cargo.lock b/Cargo.lock index eb892497..0630acd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -710,7 +710,7 @@ dependencies = [ [[package]] name = "cargo-playdate" -version = "0.4.0-alpha.3" +version = "0.4.0-beta.1" dependencies = [ "anstyle", "anyhow", diff --git a/cargo/Cargo.toml b/cargo/Cargo.toml index 0c165119..4b1f2e98 100644 --- a/cargo/Cargo.toml +++ b/cargo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-playdate" -version = "0.4.0-alpha.3" +version = "0.4.0-beta.1" readme = "README.md" description = "Build tool for neat yellow console." keywords = ["playdate", "build", "cargo", "plugin", "cargo-subcommand"] diff --git a/cargo/tests/init/init.rs b/cargo/tests/init/init.rs index 6d8876d1..0139b095 100644 --- a/cargo/tests/init/init.rs +++ b/cargo/tests/init/init.rs @@ -37,6 +37,7 @@ fn run(crate_name: &str, #[test] +#[cfg_attr(not(init_tests), ignore = "set RUSTFLAGS='--cfg init_tests' to enable.")] fn create_lib() -> Result<()> { let args = ["--full-config", "--full-metadata"].into_iter().map(OsStr::new); @@ -51,6 +52,7 @@ fn create_lib() -> Result<()> { #[test] +#[cfg_attr(not(init_tests), ignore = "set RUSTFLAGS='--cfg init_tests' to enable.")] fn create_bin() -> Result<()> { let args = ["--full-config", "--full-metadata"].into_iter().map(OsStr::new); @@ -64,6 +66,7 @@ fn create_bin() -> Result<()> { } #[test] +#[cfg_attr(not(init_tests), ignore = "set RUSTFLAGS='--cfg init_tests' to enable.")] fn create_default() -> Result<()> { let args = ["--full-config", "--full-metadata"].into_iter().map(OsStr::new); diff --git a/cargo/tests/init/new.rs b/cargo/tests/init/new.rs index 490dea04..04467996 100644 --- a/cargo/tests/init/new.rs +++ b/cargo/tests/init/new.rs @@ -37,6 +37,7 @@ fn run(crate_name: &str, #[test] +#[cfg_attr(not(init_tests), ignore = "set RUSTFLAGS='--cfg init_tests' to enable.")] fn create_lib() -> Result<()> { let args = ["--full-config", "--full-metadata"].into_iter().map(OsStr::new); @@ -51,6 +52,7 @@ fn create_lib() -> Result<()> { #[test] +#[cfg_attr(not(init_tests), ignore = "set RUSTFLAGS='--cfg init_tests' to enable.")] fn create_bin() -> Result<()> { let args = ["--full-config", "--full-metadata"].into_iter().map(OsStr::new); @@ -64,6 +66,7 @@ fn create_bin() -> Result<()> { } #[test] +#[cfg_attr(not(init_tests), ignore = "set RUSTFLAGS='--cfg init_tests' to enable.")] fn create_default() -> Result<()> { let args = ["--full-config", "--full-metadata"].into_iter().map(OsStr::new);