mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 15:01:13 +02:00
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.
This commit is contained in:
@@ -62,9 +62,10 @@ void AppTests::appTests()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
fs::create_directories([] {
|
||||||
BasicTestingSetup test{CBaseChainParams::REGTEST}; // Create a temp data directory to backup the gui settings to
|
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
|
return GetDataDir() / "blocks";
|
||||||
LogInstance().DisconnectTestLogger();
|
}());
|
||||||
|
|
||||||
m_app.parameterSetup();
|
m_app.parameterSetup();
|
||||||
m_app.createOptionsModel(true /* reset settings */);
|
m_app.createOptionsModel(true /* reset settings */);
|
||||||
@@ -80,6 +81,7 @@ void AppTests::appTests()
|
|||||||
m_app.exec();
|
m_app.exec();
|
||||||
|
|
||||||
// Reset global state to avoid interfering with later tests.
|
// Reset global state to avoid interfering with later tests.
|
||||||
|
LogInstance().DisconnectTestLogger();
|
||||||
AbortShutdown();
|
AbortShutdown();
|
||||||
UnloadBlockIndex();
|
UnloadBlockIndex();
|
||||||
WITH_LOCK(::cs_main, g_chainman.Reset());
|
WITH_LOCK(::cs_main, g_chainman.Reset());
|
||||||
|
Reference in New Issue
Block a user