-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #420: Add support for running integration tests via cargo test
139324a Remove integration test code (sanket1729) 90b5f10 Remove warnings (sanket1729) 967b95e Add support for running integration tests via cargo test (sanket1729) Pull request description: There are still some annoying warnings present for unused functions when they are used. rust-lang/rust#46379 Later commits will remove the hacky integration test setup. Running `cargo test` now should also run integration tests Our testing infrastructure now takes a long time to build because we have more than 100 dependencies (transitive). But all of these are dev dependencies, so our library isn't getting bloated. Fixes #361 ACKs for top commit: apoelstra: ACK 139324a Tree-SHA512: debf68fd0ac98cffa9c8c89964d6d1c45ee542fe17eb2fdab6295357efc06eb43a0412e6ed5d0fd7264a987989984eebb0c5b3bbf7169ecb780d31dce887cb0b
- Loading branch information
Showing
13 changed files
with
143 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
extern crate miniscript; | ||
|
||
use bitcoind::bitcoincore_rpc::RpcApi; | ||
use bitcoind::BitcoinD; | ||
use miniscript::bitcoin; | ||
|
||
pub mod test_util; | ||
|
||
// Launch an instance of bitcoind with | ||
pub fn setup() -> BitcoinD { | ||
let exe_path = bitcoind::exe_path().unwrap(); | ||
let bitcoind = bitcoind::BitcoinD::new(exe_path).unwrap(); | ||
let cl = &bitcoind.client; | ||
// generate to an address by the wallet. And wait for funds to mature | ||
let addr = cl.get_new_address(None, None).unwrap(); | ||
let blks = cl.generate_to_address(101, &addr).unwrap(); | ||
assert_eq!(blks.len(), 101); | ||
|
||
assert_eq!( | ||
cl.get_balance(Some(1) /*min conf*/, None).unwrap(), | ||
bitcoin::Amount::from_sat(100_000_000 * 50) | ||
); | ||
bitcoind | ||
} | ||
|
||
#[test] | ||
fn test_setup() { | ||
setup(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.