Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .repository-projection.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
13 changes: 12 additions & 1 deletion tests/catalog.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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`
Expand Down
13 changes: 12 additions & 1 deletion tests/cli.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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]
Expand Down
13 changes: 12 additions & 1 deletion tests/project_cli.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand Down
13 changes: 12 additions & 1 deletion tests/run_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 {
Expand Down
13 changes: 12 additions & 1 deletion tests/sdk_assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion tests/transport_git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 <command> --definition ... --source ... --source-sha ...
Expand Down