Skip to content

Commit bf98e2a

Browse files
committed
bitcoind-tests: allow overriding the BITCOIND_EXE variable
1 parent 54d7657 commit bf98e2a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

bitcoind-tests/tests/setup/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ pub mod test_util;
1010
pub fn setup() -> BitcoinD {
1111
// Create env var BITCOIND_EXE_PATH to point to the ../bitcoind/bin/bitcoind binary
1212
let key = "BITCOIND_EXE";
13-
let curr_dir_path = std::env::current_dir().unwrap();
14-
let bitcoind_path = curr_dir_path.join("bin").join("bitcoind");
15-
std::env::set_var(key, bitcoind_path);
13+
if std::env::var(key).is_err() {
14+
let curr_dir_path = std::env::current_dir().unwrap();
15+
let bitcoind_path = curr_dir_path.join("bin").join("bitcoind");
16+
std::env::set_var(key, bitcoind_path);
17+
}
1618

1719
let exe_path = bitcoind::exe_path().unwrap();
1820
let bitcoind = bitcoind::BitcoinD::new(exe_path).unwrap();

contrib/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fi
4040
# Test bitcoind integration tests if told to (this only works with the stable toolchain)
4141
if [ "$DO_BITCOIND_TESTS" = true ]; then
4242
cd bitcoind-tests
43+
BITCOIND_EXE="$(git rev-parse --show-toplevel)/bitcoind-tests/bin/bitcoind" \
4344
cargo test --verbose
4445

4546
# Exit integration tests, do not run other tests.

0 commit comments

Comments
 (0)