aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorSamuel Dobson <dobsonsa68@gmail.com>2020-07-11 23:11:15 +1200
committerSamuel Dobson <dobsonsa68@gmail.com>2020-07-11 23:23:28 +1200
commit5f96bce9b7f38c687817d58e8b54a5b7ebfe91b3 (patch)
tree9edeacae57242b6dff3028adc8b867e9d88adf1a /src/qt
parent89899a344861c27ad31dc09334fa88ec9402dba4 (diff)
parentfa73493930e35850e877725167dc9d42e47015c8 (diff)
downloadbitcoin-5f96bce9b7f38c687817d58e8b54a5b7ebfe91b3.tar.xz
Merge #18923: wallet: Never schedule MaybeCompactWalletDB when -flushwallet is off
fa73493930e35850e877725167dc9d42e47015c8 refactor: Use C++11 range-based for loop (MarcoFalke) fa7b164d62d9f12e9cda79bf28bf435acf2d1e38 wallet: Never schedule MaybeCompactWalletDB when -flushwallet is off (MarcoFalke) faf8401c195f52470d1ca6e2c94cb3820e57ee41 wallet: Pass unused args to StartWallets (MarcoFalke) fa6c186436337c8ed7d9e1ab065377f8cda5c0b7 gui tests: Limit life-time of dummy testing setup (MarcoFalke) fa28a618972911239a119248ab1194702a5c36d8 test: Add smoke test to check that wallets are flushed by default (MarcoFalke) Pull request description: User-facing, this is a refactor. Internally, the scheduler does not have to call a mostly empty function every half a second. ACKs for top commit: jnewbery: utACK fa73493930e35850e877725167dc9d42e47015c8 meshcollider: utACK fa73493930e35850e877725167dc9d42e47015c8 ryanofsky: Code review ACK fa73493930e35850e877725167dc9d42e47015c8. Just rebased since last review Tree-SHA512: 99e1fe1b2c22a3f4b19de3e566241d38693f4fd8d5a68ba1838d86740aa6c08e3325c11a072e30fd262a8861af4278bed52eb9374c85179b8f536477f528247c
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/test/apptests.cpp8
-rw-r--r--src/qt/test/test_main.cpp4
2 files changed, 8 insertions, 4 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());
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index aefdcd2716..12efca2503 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -40,7 +40,7 @@ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
const std::function<void(const std::string&)> G_TEST_LOG_FUN{};
// This is all you need to run all the tests
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
{
// Initialize persistent globals with the testing setup state for sanity.
// E.g. -datadir in gArgs is set to a temp directory dummy value (instead
@@ -70,6 +70,8 @@ int main(int argc, char *argv[])
BitcoinApplication app(*node);
app.setApplicationName("Bitcoin-Qt-test");
+ node->setupServerArgs(); // Make gArgs available in the NodeContext
+ node->context()->args->ClearArgs(); // Clear added args again
AppTests app_tests(app);
if (QTest::qExec(&app_tests) != 0) {
fInvalid = true;