diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-07-12 07:46:43 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-07-12 07:47:53 -0400 |
commit | d3dae3ddf9fa95d652dfdf44bb496617513644a2 (patch) | |
tree | 7c5ab04e589faf3aec0ea5c7adc70df54e4938a5 /src/test/test_bitcoin.h | |
parent | 5ba77df15de92deb35bfd501d4635aed3236af30 (diff) | |
parent | 075429a482392050c8e9008d9c990d185054a597 (diff) | |
download | bitcoin-d3dae3ddf9fa95d652dfdf44bb496617513644a2.tar.xz |
Merge #13145: Use common getPath method to create temp directory in tests.
075429a482 Use common SetDataDir method to create temp directory in tests. (winder)
Pull request description:
Took a stab at #12574
Created a `getPath` method which can be used with the `TestingSetup` fixture to create a temp directory. Updated tests using temp directories to use this method.
I tried setting up a `BOOST_GLOBAL_FIXTURE` to create a truly global path for all tests but was getting linker errors when including `boost/test/unit_test.hpp` in `test_bitcoin.cpp`. Even if I had gotten the linking to work, it looks like `make check` invokes the test binary a bunch of times, so it may not have worked anyway.
Tree-SHA512: b51d0f5fada5d652ccc9362596cf98a742aa47f5daf94f189b5f034d8c035c85d095377befdcff7fb4247154d5160e8c500d70f554a2158e2c185a9d24f694f1
Diffstat (limited to 'src/test/test_bitcoin.h')
-rw-r--r-- | src/test/test_bitcoin.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h index d013613de2..88b2d37e87 100644 --- a/src/test/test_bitcoin.h +++ b/src/test/test_bitcoin.h @@ -45,6 +45,11 @@ struct BasicTestingSetup { explicit BasicTestingSetup(const std::string& chainName = CBaseChainParams::MAIN); ~BasicTestingSetup(); + + fs::path SetDataDir(const std::string& name); + +private: + const fs::path m_path_root; }; /** Testing setup that configures a complete environment. @@ -59,7 +64,6 @@ struct CConnmanTest { class PeerLogicValidation; struct TestingSetup: public BasicTestingSetup { - fs::path pathTemp; boost::thread_group threadGroup; CConnman* connman; CScheduler scheduler; |