Skip to content

Commit

Permalink
Merge pull request #266 from boozook/cargo-init-tests
Browse files Browse the repository at this point in the history
Split `init` tests
  • Loading branch information
github-actions[bot] authored Apr 3, 2024
2 parents 24dc26b + fcd152e commit 88f328b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cargo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
3 changes: 3 additions & 0 deletions cargo/tests/init/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down
3 changes: 3 additions & 0 deletions cargo/tests/init/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 88f328b

Please sign in to comment.