Update xtask to be (roughly) consistent with CI

This commit is contained in:
dbr 2021-11-16 19:39:51 +11:00
parent 744fc7cb79
commit f677dcdc4c

View File

@ -32,11 +32,18 @@ fn try_main() -> Result<()> {
} }
fn lint_all() -> Result<()> { fn lint_all() -> Result<()> {
// Lint with only default, only docking, and only freetype
xshell::cmd!("cargo clippy --workspace --all-targets").run()?; xshell::cmd!("cargo clippy --workspace --all-targets").run()?;
xshell::cmd!("cargo clippy --workspace --all-targets --features docking").run()?;
xshell::cmd!("cargo clippy --workspace --all-targets --features freetype").run()?;
// Lint winit with all features
xshell::cmd!( xshell::cmd!(
"cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets" "cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets"
) )
.run()?; .run()?;
// Lint with various winit versions
let winits = &[ let winits = &[
"winit-19", "winit-19",
"winit-20", "winit-20",
@ -48,13 +55,22 @@ fn lint_all() -> Result<()> {
for &winit in winits { for &winit in winits {
xshell::cmd!("cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?; xshell::cmd!("cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?;
} }
// Check formatting
xshell::cmd!("cargo fmt --all -- --check").run()?; xshell::cmd!("cargo fmt --all -- --check").run()?;
Ok(()) Ok(())
} }
fn test_all() -> Result<()> { fn test_all() -> Result<()> {
// Test with default/docking/freetype features
xshell::cmd!("cargo test --workspace --all-targets").run()?; xshell::cmd!("cargo test --workspace --all-targets").run()?;
xshell::cmd!("cargo test --workspace --all-targets --features docking").run()?;
xshell::cmd!("cargo test --workspace --all-targets --features freetype").run()?;
// Test doc examples
xshell::cmd!("cargo test --workspace --doc").run()?; xshell::cmd!("cargo test --workspace --doc").run()?;
// Test with various winit versions
let winits = &[ let winits = &[
"winit-19", "winit-19",
"winit-20", "winit-20",
@ -66,6 +82,7 @@ fn test_all() -> Result<()> {
for &winit in winits { for &winit in winits {
xshell::cmd!("cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?; xshell::cmd!("cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?;
} }
// Run heavy tests in release mode
xshell::cmd!("cargo test -p imgui --release -- --ignored").run()?; xshell::cmd!("cargo test -p imgui --release -- --ignored").run()?;
Ok(()) Ok(())
} }