aboutsummaryrefslogtreecommitdiffstats
path: root/xtask/src
diff options
context:
space:
mode:
authorThomas Linford <tlinford@users.noreply.github.com>2026-03-05 17:38:17 +0100
committerGitHub <noreply@github.com>2026-03-05 17:38:17 +0100
commita431e52b3d0ea3b45908a36ab0bf5d9d0eb285cb (patch)
treeb9223782543f64ce5e71c304e023f33c9794c0e5 /xtask/src
parentbuild: fix redundant proto codegen, plugin batch building, and profile mismat... (diff)
downloadsl0ppij-a431e52b3d0ea3b45908a36ab0bf5d9d0eb285cb.tar.gz
sl0ppij-a431e52b3d0ea3b45908a36ab0bf5d9d0eb285cb.tar.xz
sl0ppij-a431e52b3d0ea3b45908a36ab0bf5d9d0eb285cb.zip
build: make test mirror build command for plugins (#4801)
* build: make test mirror build command for plugins * update changelog
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/test.rs35
1 files changed, 31 insertions, 4 deletions
diff --git a/xtask/src/test.rs b/xtask/src/test.rs
index 87cda203..49e079d8 100644
--- a/xtask/src/test.rs
+++ b/xtask/src/test.rs
@@ -21,16 +21,43 @@ pub fn test(sh: &Shell, flags: flags::Test) -> anyhow::Result<()> {
)
.context(err_context)?;
- for WorkspaceMember { crate_name, .. } in crate::workspace_members().iter() {
+ // Test all plugins in a single invocation so Cargo unifies features and compiles
+ // shared crates (e.g. zellij-utils) only once, mirroring how plugins are built.
+ {
+ let plugin_names: Vec<&str> = crate::workspace_members()
+ .iter()
+ .filter(|m| m.crate_name.contains("plugins"))
+ .map(|m| m.crate_name.rsplit_once('/').unwrap().1)
+ .collect();
+
+ if !plugin_names.is_empty() {
+ println!();
+ let msg = ">> Testing plugins";
+ crate::status(msg);
+ println!("{}", msg);
+
+ let mut cmd = cmd!(sh, "{cargo} test --target {host_triple}");
+ for name in &plugin_names {
+ cmd = cmd.args(["-p", name]);
+ }
+ cmd.arg("--")
+ .args(&flags.args)
+ .run()
+ .context("Failed to run plugin tests")?;
+ }
+ }
+
+ for WorkspaceMember { crate_name, .. } in crate::workspace_members()
+ .iter()
+ .filter(|m| !m.crate_name.contains("plugins"))
+ {
let _pd = sh.push_dir(Path::new(crate_name));
println!();
let msg = format!(">> Testing '{}'", crate_name);
crate::status(&msg);
println!("{}", msg);
- let cmd = if crate_name.contains("plugins") {
- cmd!(sh, "{cargo} test --target {host_triple} --")
- } else if flags.no_web {
+ let cmd = if flags.no_web {
// Check if this crate has web features that need modification
match metadata::get_no_web_features(sh, crate_name)
.context("Failed to check web features")?