aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-11 17:33:46 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-07-09 13:07:35 +0200
commitfa6c186436337c8ed7d9e1ab065377f8cda5c0b7 (patch)
tree26203f1241d9d6e7c00bc90cdc20e424ebdaf584 /src/qt
parentfa28a618972911239a119248ab1194702a5c36d8 (diff)
downloadbitcoin-fa6c186436337c8ed7d9e1ab065377f8cda5c0b7.tar.xz
gui tests: Limit life-time of dummy testing setup
Its only purpose is to create a directory. So instead of keeping it alive, use it only to get the path of the directory and then create it explicitly.
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/test/apptests.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp
index f88d57c716..443e2d047d 100644
--- a/src/qt/test/apptests.cpp
+++ b/src/qt/test/apptests.cpp
@@ -62,9 +62,10 @@ void AppTests::appTests()
}
#endif
- BasicTestingSetup test{CBaseChainParams::REGTEST}; // Create a temp data directory to backup the gui settings to
- ECC_Stop(); // Already started by the common test setup, so stop it to avoid interference
- LogInstance().DisconnectTestLogger();
+ fs::create_directories([] {
+ BasicTestingSetup test{CBaseChainParams::REGTEST}; // Create a temp data directory to backup the gui settings to
+ return GetDataDir() / "blocks";
+ }());
m_app.parameterSetup();
m_app.createOptionsModel(true /* reset settings */);
@@ -80,6 +81,7 @@ void AppTests::appTests()
m_app.exec();
// Reset global state to avoid interfering with later tests.
+ LogInstance().DisconnectTestLogger();
AbortShutdown();
UnloadBlockIndex();
WITH_LOCK(::cs_main, g_chainman.Reset());