Run tests twice, one for main crate and once for subcrate

It seems like restoring the cache for subcrate deletes sometimes removes the compiled binaries for
the parent crate. I'm not sure what's going on here, as it doesn't happen every time.
This commit is contained in:
Dave Rolsky
2025-01-11 12:49:28 -06:00
parent a8c1049914
commit 8a64ff717c
2 changed files with 53 additions and 35 deletions

View File

@@ -24,6 +24,8 @@ struct Args {
expect_cross_version: Option<String>,
#[arg(long)]
expect_stripped: bool,
#[arg(long)]
is_subcrate: bool,
}
fn main() {
@@ -39,24 +41,27 @@ fn main() {
);
let checkout_root_path = PathBuf::from(args.checkout_root);
let bin_paths = vec![
checkout_root_path
.join("target")
.join(&args.target)
.join("debug")
.join("bin1"),
checkout_root_path
.join("target")
.join(&args.target)
.join("debug")
.join("bin2"),
checkout_root_path
let bin_paths = if args.is_subcrate {
vec![checkout_root_path
.join("subcrate")
.join("target")
.join(&args.target)
.join("debug")
.join("subcrate"),
];
.join("subcrate")]
} else {
vec![
checkout_root_path
.join("target")
.join(&args.target)
.join("debug")
.join("bin1"),
checkout_root_path
.join("target")
.join(&args.target)
.join("debug")
.join("bin2"),
]
};
for mut bin_path in bin_paths {
if cfg!(windows) {