Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split init tests #266

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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