mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-06 14:19:59 -05:00
qt, test: Clean settings after tests
A test suite should not leave any artifacts except for those explicitly expected. This change is easy to review with `git diff --ignore-all-space` command.
This commit is contained in:
parent
49cf63522e
commit
0dcbad341b
1 changed files with 28 additions and 20 deletions
|
@ -85,37 +85,45 @@ int main(int argc, char* argv[])
|
||||||
setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
|
setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BitcoinApplication app;
|
|
||||||
app.setOrganizationName(QAPP_ORG_NAME);
|
QCoreApplication::setOrganizationName(QAPP_ORG_NAME);
|
||||||
app.setApplicationName(QAPP_APP_NAME_DEFAULT "-test");
|
QCoreApplication::setApplicationName(QAPP_APP_NAME_DEFAULT "-test");
|
||||||
app.createNode(*init);
|
|
||||||
|
|
||||||
int num_test_failures{0};
|
int num_test_failures{0};
|
||||||
|
|
||||||
AppTests app_tests(app);
|
{
|
||||||
num_test_failures += QTest::qExec(&app_tests);
|
BitcoinApplication app;
|
||||||
|
app.createNode(*init);
|
||||||
|
|
||||||
OptionTests options_tests(app.node());
|
AppTests app_tests(app);
|
||||||
num_test_failures += QTest::qExec(&options_tests);
|
num_test_failures += QTest::qExec(&app_tests);
|
||||||
|
|
||||||
URITests test1;
|
OptionTests options_tests(app.node());
|
||||||
num_test_failures += QTest::qExec(&test1);
|
num_test_failures += QTest::qExec(&options_tests);
|
||||||
|
|
||||||
RPCNestedTests test3(app.node());
|
URITests test1;
|
||||||
num_test_failures += QTest::qExec(&test3);
|
num_test_failures += QTest::qExec(&test1);
|
||||||
|
|
||||||
|
RPCNestedTests test3(app.node());
|
||||||
|
num_test_failures += QTest::qExec(&test3);
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
WalletTests test5(app.node());
|
WalletTests test5(app.node());
|
||||||
num_test_failures += QTest::qExec(&test5);
|
num_test_failures += QTest::qExec(&test5);
|
||||||
|
|
||||||
AddressBookTests test6(app.node());
|
AddressBookTests test6(app.node());
|
||||||
num_test_failures += QTest::qExec(&test6);
|
num_test_failures += QTest::qExec(&test6);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (num_test_failures) {
|
if (num_test_failures) {
|
||||||
qWarning("\nFailed tests: %d\n", num_test_failures);
|
qWarning("\nFailed tests: %d\n", num_test_failures);
|
||||||
} else {
|
} else {
|
||||||
qDebug("\nAll tests passed.\n");
|
qDebug("\nAll tests passed.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
settings.clear();
|
||||||
|
|
||||||
return num_test_failures;
|
return num_test_failures;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue