From d50947cde1231ecf2cd3349f89d9bc001d71dfd2 Mon Sep 17 00:00:00 2001 From: Krzysztof Andrelczyk Date: Fri, 7 Mar 2025 20:38:11 +0100 Subject: [PATCH] windows tests --- .../updater/tests/app-updater/tests/update.rs | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/plugins/updater/tests/app-updater/tests/update.rs b/plugins/updater/tests/app-updater/tests/update.rs index 58e9594e..924fe6ec 100644 --- a/plugins/updater/tests/app-updater/tests/update.rs +++ b/plugins/updater/tests/app-updater/tests/update.rs @@ -56,20 +56,19 @@ fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, targets: Vec>(); command.args(["--bundles"]); #[cfg(target_os = "linux")] - command.args(targets.into_iter().map(|t| t.name()).collect::>()); + command.args(cmd_args); #[cfg(target_os = "macos")] - command.args([target.name()]); + command.args(cmd_args); if bundle_updater { #[cfg(windows)] command.args(["msi", "nsis"]); - - command.args(["updater"]); } else { #[cfg(windows)] - command.args([target.name()]); + command.args(cmd_args); } let status = command .status() @@ -202,24 +201,60 @@ fn bundle_path(root_dir: &Path, _version: &str, v1compatible: bool) -> PathBuf { } #[cfg(windows)] -fn bundle_paths( +fn test_cases( root_dir: &Path, version: &str, - v1compatible: bool, -) -> Vec<(BundleTarget, PathBuf)> { + target: String +) -> Vec<(BundleTarget, PathBuf, Option, Vec)> { vec![ ( BundleTarget::Nsis, root_dir.join(format!( "target/debug/bundle/nsis/app-updater_{version}_x64-setup.exe" )), + Some(target.clone()), + vec![UPDATED_EXIT_CODE] + ), + ( + BundleTarget::Nsis, + root_dir.join(format!( + "target/debug/bundle/nsis/app-updater_{version}_x64-setup.exe" + )), + Some(format!("{target}-{}", BundleTarget::Nsis.name())), + vec![UPDATED_EXIT_CODE] + ), + ( + BundleTarget::Nsis, + root_dir.join(format!( + "target/debug/bundle/nsis/app-updater_{version}_x64-setup.exe" + )), + None, + vec![ERROR_EXIT_CODE] + ), + ( + BundleTarget::Msi, + root_dir.join(format!( + "target/debug/bundle/msi/app-updater_{version}_x64_en-US.msi" + )), + Some(target.clone()), + vec![UPDATED_EXIT_CODE] ), ( BundleTarget::Msi, root_dir.join(format!( "target/debug/bundle/msi/app-updater_{version}_x64_en-US.msi" )), + Some(format!("{target}-{}", BundleTarget::Msi.name())), + vec![UPDATED_EXIT_CODE] ), + ( + BundleTarget::Msi, + root_dir.join(format!( + "target/debug/bundle/msi/app-updater_{version}_x64_en-US.msi" + )), + None, + vec![ERROR_EXIT_CODE] + ) ] }