diff --git a/.repository-projection.json b/.repository-projection.json index 64779ef..e053310 100644 --- a/.repository-projection.json +++ b/.repository-projection.json @@ -3,11 +3,11 @@ "projection": "capobara", "projectionSchemaVersion": 1, "sourceRepository": "dx-corp/mono", - "sourceSha": "2df44a8283c07c0ba875174e70d2aaabb72d19cc", + "sourceSha": "3ccfbea716d8d52596980ca1f1f3b62166e7849d", "destinationRepository": "dx-corp/capobara", - "priorProjectedBase": "05f55084905bd7f79cee5c2490fa63f01ee9c43e", + "priorProjectedBase": "72796ef8e718acb181dbf0e101fe4b0af45b62e9", "definitionDigest": "7826c75cbd356dad6c867f2606ebde8b79ef4361353908cf33ada720034ec488", - "toolDigest": "f58d71f023a4f0a27d77cb96dcc5348a40816d0b", - "contentDigest": "c364d273ea10128a23de009cd2180dde514640e12bb6494bd36f246afe778bc0", + "toolDigest": "898e8657d9153a2a51d7c283bf83bb3350b5d1e6", + "contentDigest": "e885e1248460736b96bfc794621e93051f8756668175e264adc51b6ce53ed7e3", "publicationEligible": true } diff --git a/tests/catalog.rs b/tests/catalog.rs index 509cfba..132de84 100644 --- a/tests/catalog.rs +++ b/tests/catalog.rs @@ -1,3 +1,14 @@ +macro_rules! cargo_bin { + ($name:literal) => {{ + option_env!(concat!("CARGO_BIN_EXE_", $name)) + .map(std::path::PathBuf::from) + .or_else(|| { + std::env::var_os(concat!("CARGO_BIN_EXE_", $name)).map(std::path::PathBuf::from) + }) + .expect(concat!("Cargo binary path unavailable: ", $name)) + }}; +} + mod support; use capobara::catalog::{assert_main_authorized_revision, publication_matrix, read_catalog}; use support::Repo; @@ -156,7 +167,7 @@ fn capobara() -> std::process::Command { clippy::disallowed_methods, reason = "integration test executes the capobara binary" )] - std::process::Command::new(env!("CARGO_BIN_EXE_capobara")) + std::process::Command::new(cargo_bin!("capobara")) } /// `catalog check`/`catalog matrix`'s `--root` resolution. Node's `ROOT` diff --git a/tests/cli.rs b/tests/cli.rs index aa6ad6f..f5a7481 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -1,3 +1,14 @@ +macro_rules! cargo_bin { + ($name:literal) => {{ + option_env!(concat!("CARGO_BIN_EXE_", $name)) + .map(std::path::PathBuf::from) + .or_else(|| { + std::env::var_os(concat!("CARGO_BIN_EXE_", $name)).map(std::path::PathBuf::from) + }) + .expect(concat!("Cargo binary path unavailable: ", $name)) + }}; +} + mod support; use std::process::Command; @@ -7,7 +18,7 @@ fn bin() -> Command { clippy::disallowed_methods, reason = "integration test executes the capobara binary" )] - Command::new(env!("CARGO_BIN_EXE_capobara")) + Command::new(cargo_bin!("capobara")) } #[test] diff --git a/tests/project_cli.rs b/tests/project_cli.rs index 0478abe..24fe197 100644 --- a/tests/project_cli.rs +++ b/tests/project_cli.rs @@ -1,3 +1,14 @@ +macro_rules! cargo_bin { + ($name:literal) => {{ + option_env!(concat!("CARGO_BIN_EXE_", $name)) + .map(std::path::PathBuf::from) + .or_else(|| { + std::env::var_os(concat!("CARGO_BIN_EXE_", $name)).map(std::path::PathBuf::from) + }) + .expect(concat!("Cargo binary path unavailable: ", $name)) + }}; +} + mod support; use std::process::Command; use support::Repo; @@ -7,7 +18,7 @@ fn capobara() -> Command { clippy::disallowed_methods, reason = "integration test executes the capobara binary" )] - Command::new(env!("CARGO_BIN_EXE_capobara")) + Command::new(cargo_bin!("capobara")) } fn definition_json(name: &str) -> String { diff --git a/tests/run_cli.rs b/tests/run_cli.rs index 23ac08b..92ba57a 100644 --- a/tests/run_cli.rs +++ b/tests/run_cli.rs @@ -39,6 +39,17 @@ // failing. #![cfg(debug_assertions)] +macro_rules! cargo_bin { + ($name:literal) => {{ + option_env!(concat!("CARGO_BIN_EXE_", $name)) + .map(std::path::PathBuf::from) + .or_else(|| { + std::env::var_os(concat!("CARGO_BIN_EXE_", $name)).map(std::path::PathBuf::from) + }) + .expect(concat!("Cargo binary path unavailable: ", $name)) + }}; +} + mod support; use std::path::{Path, PathBuf}; @@ -125,7 +136,7 @@ fn capobara() -> Command { clippy::disallowed_methods, reason = "integration test executes the capobara binary" )] - Command::new(env!("CARGO_BIN_EXE_capobara")) + Command::new(cargo_bin!("capobara")) } fn run_git(path: &Path, args: &[&str]) -> String { diff --git a/tests/sdk_assembly.rs b/tests/sdk_assembly.rs index db732cd..84d8d7b 100644 --- a/tests/sdk_assembly.rs +++ b/tests/sdk_assembly.rs @@ -15,6 +15,17 @@ //! the closure's extension swap expects); and the Go closure's `deixic/v1` //! root imports every other generated Go package by its full module path. +macro_rules! cargo_bin { + ($name:literal) => {{ + option_env!(concat!("CARGO_BIN_EXE_", $name)) + .map(std::path::PathBuf::from) + .or_else(|| { + std::env::var_os(concat!("CARGO_BIN_EXE_", $name)).map(std::path::PathBuf::from) + }) + .expect(concat!("Cargo binary path unavailable: ", $name)) + }}; +} + mod support; use std::collections::BTreeSet; @@ -431,7 +442,7 @@ fn capobara() -> Command { clippy::disallowed_methods, reason = "integration test executes the capobara binary" )] - Command::new(env!("CARGO_BIN_EXE_capobara")) + Command::new(cargo_bin!("capobara")) } // Debug-only, like `tests/project_cli.rs`: the synthetic source repository's diff --git a/tests/transport_git.rs b/tests/transport_git.rs index 2f15688..e160d5a 100644 --- a/tests/transport_git.rs +++ b/tests/transport_git.rs @@ -45,6 +45,17 @@ // off (e.g. `cargo test --release`) instead of failing to compile. #![cfg(debug_assertions)] #![allow(dead_code)] +macro_rules! cargo_bin { + ($name:literal) => {{ + option_env!(concat!("CARGO_BIN_EXE_", $name)) + .map(std::path::PathBuf::from) + .or_else(|| { + std::env::var_os(concat!("CARGO_BIN_EXE_", $name)).map(std::path::PathBuf::from) + }) + .expect(concat!("Cargo binary path unavailable: ", $name)) + }}; +} + mod support; use std::path::{Path, PathBuf}; @@ -143,7 +154,7 @@ fn capobara() -> Command { clippy::disallowed_methods, reason = "integration test executes the capobara binary" )] - Command::new(env!("CARGO_BIN_EXE_capobara")) + Command::new(cargo_bin!("capobara")) } /// Runs `capobara --definition ... --source ... --source-sha ...