diff options
author | Jon Atack <jon@atack.com> | 2022-04-06 23:39:51 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-04-06 23:52:05 +0200 |
commit | 2489b6fe9cd1b669362d459e93185ca0bd9f8714 (patch) | |
tree | cd800345321fe252c7b10b5d4fb8737241e1fbe1 /src/qt/test | |
parent | ba44aae7683f412626baa8bf51708ddf25f51ba8 (diff) | |
download | bitcoin-2489b6fe9cd1b669362d459e93185ca0bd9f8714.tar.xz |
gui: count test failures in test runner summary
Diffstat (limited to 'src/qt/test')
-rw-r--r-- | src/qt/test/test_main.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 834f31dd53..6a895ae9b4 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -71,8 +71,6 @@ int main(int argc, char* argv[]) gArgs.ForceSetArg("-upnp", "0"); gArgs.ForceSetArg("-natpmp", "0"); - bool fInvalid = false; - // Prefer the "minimal" platform for the test instead of the normal default // platform ("xcb", "windows", or "cocoa") so tests can't unintentionally // interfere with any background GUIs and don't require extra resources. @@ -88,35 +86,30 @@ int main(int argc, char* argv[]) app.setApplicationName("Bitcoin-Qt-test"); app.createNode(*init); + int fInvalid{0}; + AppTests app_tests(app); - if (QTest::qExec(&app_tests) != 0) { - fInvalid = true; - } + fInvalid += QTest::qExec(&app_tests); + OptionTests options_tests(app.node()); - if (QTest::qExec(&options_tests) != 0) { - fInvalid = true; - } + fInvalid += QTest::qExec(&options_tests); + URITests test1; - if (QTest::qExec(&test1) != 0) { - fInvalid = true; - } + fInvalid += QTest::qExec(&test1); + RPCNestedTests test3(app.node()); - if (QTest::qExec(&test3) != 0) { - fInvalid = true; - } + fInvalid += QTest::qExec(&test3); + #ifdef ENABLE_WALLET WalletTests test5(app.node()); - if (QTest::qExec(&test5) != 0) { - fInvalid = true; - } + fInvalid += QTest::qExec(&test5); + AddressBookTests test6(app.node()); - if (QTest::qExec(&test6) != 0) { - fInvalid = true; - } + fInvalid += QTest::qExec(&test6); #endif if (fInvalid) { - qWarning("\nThere were errors in some of the tests above.\n"); + qWarning("\nFailed tests: %d\n", fInvalid); } else { qDebug("\nAll tests passed.\n"); } |