@@ -71,8 +71,6 @@ int main(int argc, char* argv[])
71
71
gArgs .ForceSetArg (" -upnp" , " 0" );
72
72
gArgs .ForceSetArg (" -natpmp" , " 0" );
73
73
74
- bool fInvalid = false ;
75
-
76
74
// Prefer the "minimal" platform for the test instead of the normal default
77
75
// platform ("xcb", "windows", or "cocoa") so tests can't unintentionally
78
76
// interfere with any background GUIs and don't require extra resources.
@@ -88,35 +86,30 @@ int main(int argc, char* argv[])
88
86
app.setApplicationName (" Bitcoin-Qt-test" );
89
87
app.createNode (*init);
90
88
89
+ int fInvalid {0 };
90
+
91
91
AppTests app_tests (app);
92
- if (QTest::qExec (&app_tests) != 0 ) {
93
- fInvalid = true ;
94
- }
92
+ fInvalid += QTest::qExec (&app_tests);
93
+
95
94
OptionTests options_tests (app.node ());
96
- if (QTest::qExec (&options_tests) != 0 ) {
97
- fInvalid = true ;
98
- }
95
+ fInvalid += QTest::qExec (&options_tests);
96
+
99
97
URITests test1;
100
- if (QTest::qExec (&test1) != 0 ) {
101
- fInvalid = true ;
102
- }
98
+ fInvalid += QTest::qExec (&test1);
99
+
103
100
RPCNestedTests test3 (app.node ());
104
- if (QTest::qExec (&test3) != 0 ) {
105
- fInvalid = true ;
106
- }
101
+ fInvalid += QTest::qExec (&test3);
102
+
107
103
#ifdef ENABLE_WALLET
108
104
WalletTests test5 (app.node ());
109
- if (QTest::qExec (&test5) != 0 ) {
110
- fInvalid = true ;
111
- }
105
+ fInvalid += QTest::qExec (&test5);
106
+
112
107
AddressBookTests test6 (app.node ());
113
- if (QTest::qExec (&test6) != 0 ) {
114
- fInvalid = true ;
115
- }
108
+ fInvalid += QTest::qExec (&test6);
116
109
#endif
117
110
118
111
if (fInvalid ) {
119
- qWarning (" \n There were errors in some of the tests above. \n " );
112
+ qWarning (" \n Failed tests: %d \n " , fInvalid );
120
113
} else {
121
114
qDebug (" \n All tests passed.\n " );
122
115
}
0 commit comments