Skip to content
Open
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
11 changes: 2 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/cargo-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ current_platform = "0.2.0"
which = "8.0.0"

[dev-dependencies]
assert_cmd = "=2.0.17"
assert_cmd = "=2.1.1"
regex = "1.11.1"
predicates = "3.1.3"
tempfile = "3.23.0"
Expand Down
10 changes: 9 additions & 1 deletion crates/cargo-contract/tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ pub mod node_proc;

/// Create a `cargo contract` command
pub fn cargo_contract<P: AsRef<Path>>(path: P) -> assert_cmd::Command {
let mut cmd = assert_cmd::Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
let mut cmd = if let Ok(nextest_bin) = std::env::var("NEXTEST_BIN_EXE_cargo-contract")
{
// When running with nextest archive, use NEXTEST_BIN_EXE_* which has the
// correct remapped path
assert_cmd::Command::new(nextest_bin)
} else {
// Fall back to cargo_bin_cmd! for normal cargo test
assert_cmd::cargo::cargo_bin_cmd!(env!("CARGO_PKG_NAME"))
};
cmd.current_dir(path).arg("contract");
cmd
}
2 changes: 1 addition & 1 deletion crates/extrinsics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ink_env = { workspace = true }

[dev-dependencies]
ink = { version = "6.0.0-beta.1", features = ["unstable-hostfn"] }
assert_cmd = "=2.0.17"
assert_cmd = "=2.1.1"
regex = "1.11.1"
predicates = "3.1.3"
tempfile = "3.23.0"
Expand Down
13 changes: 12 additions & 1 deletion crates/extrinsics/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,18 @@ const CONTRACTS_NODE: &str = "ink-node";

/// Create a `cargo contract` command
fn cargo_contract(path: &Path) -> assert_cmd::Command {
let mut cmd = assert_cmd::Command::cargo_bin("cargo-contract").unwrap();
let mut cmd = if let Ok(nextest_bin) = std::env::var("NEXTEST_BIN_EXE_cargo-contract")
{
// When running with nextest archive, use NEXTEST_BIN_EXE_* which has the
// correct remapped path
assert_cmd::Command::new(nextest_bin)
} else {
// Fall back to cargo_bin for normal cargo test
// Note: cargo_bin is deprecated but we can't use cargo_bin_cmd! since we're
// testing a binary from a different crate
#[allow(deprecated)]
assert_cmd::Command::cargo_bin("cargo-contract").unwrap()
};
cmd.current_dir(path).arg("contract");
cmd
}
Expand Down
Loading