Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/test_main.cpp
Show All 15 Lines | |||||
#include <qt/test/apptests.h> | #include <qt/test/apptests.h> | ||||
#include <qt/test/bitcoinaddressvalidatortests.h> | #include <qt/test/bitcoinaddressvalidatortests.h> | ||||
#include <qt/test/compattests.h> | #include <qt/test/compattests.h> | ||||
#include <qt/test/guiutiltests.h> | #include <qt/test/guiutiltests.h> | ||||
#include <qt/test/rpcnestedtests.h> | #include <qt/test/rpcnestedtests.h> | ||||
#include <qt/test/uritests.h> | #include <qt/test/uritests.h> | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
#include <qt/test/addressbooktests.h> | #include <qt/test/addressbooktests.h> | ||||
#ifdef ENABLE_BIP70 | |||||
#include <qt/test/paymentservertests.h> | #include <qt/test/paymentservertests.h> | ||||
#endif // ENABLE_BIP70 | |||||
#include <qt/test/wallettests.h> | #include <qt/test/wallettests.h> | ||||
#endif | #endif // ENABLE_WALLET | ||||
#include <QApplication> | #include <QApplication> | ||||
#include <QObject> | #include <QObject> | ||||
#include <QTest> | #include <QTest> | ||||
#ifdef ENABLE_BIP70 | |||||
#include <openssl/ssl.h> | #include <openssl/ssl.h> | ||||
#endif | |||||
#if defined(QT_STATICPLUGIN) | #if defined(QT_STATICPLUGIN) | ||||
#include <QtPlugin> | #include <QtPlugin> | ||||
#if defined(QT_QPA_PLATFORM_MINIMAL) | #if defined(QT_QPA_PLATFORM_MINIMAL) | ||||
Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin); | Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin); | ||||
#endif | #endif | ||||
#if defined(QT_QPA_PLATFORM_XCB) | #if defined(QT_QPA_PLATFORM_XCB) | ||||
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); | Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); | ||||
Show All 28 Lines | int main(int argc, char *argv[]) { | ||||
// interfere with any background GUIs and don't require extra resources. | // interfere with any background GUIs and don't require extra resources. | ||||
setenv("QT_QPA_PLATFORM", "minimal", 0); | setenv("QT_QPA_PLATFORM", "minimal", 0); | ||||
// Don't remove this, it's needed to access | // Don't remove this, it's needed to access | ||||
// QApplication:: and QCoreApplication:: in the tests | // QApplication:: and QCoreApplication:: in the tests | ||||
BitcoinApplication app(*node, argc, argv); | BitcoinApplication app(*node, argc, argv); | ||||
app.setApplicationName("BitcoinABC-Qt-test"); | app.setApplicationName("BitcoinABC-Qt-test"); | ||||
#ifdef ENABLE_BIP70 | |||||
// This is necessary to initialize openssl on the test framework | // This is necessary to initialize openssl on the test framework | ||||
// (at least on Darwin). | // (at least on Darwin). | ||||
SSL_library_init(); | SSL_library_init(); | ||||
#endif | |||||
AppTests app_tests(app); | AppTests app_tests(app); | ||||
if (QTest::qExec(&app_tests) != 0) { | if (QTest::qExec(&app_tests) != 0) { | ||||
fInvalid = true; | fInvalid = true; | ||||
} | } | ||||
URITests test1; | URITests test1; | ||||
if (QTest::qExec(&test1) != 0) { | if (QTest::qExec(&test1) != 0) { | ||||
fInvalid = true; | fInvalid = true; | ||||
} | } | ||||
#ifdef ENABLE_WALLET | #if defined(ENABLE_WALLET) && defined(ENABLE_BIP70) | ||||
PaymentServerTests test2; | PaymentServerTests test2; | ||||
if (QTest::qExec(&test2) != 0) { | if (QTest::qExec(&test2) != 0) { | ||||
fInvalid = true; | fInvalid = true; | ||||
} | } | ||||
#endif | #endif | ||||
RPCNestedTests test3; | RPCNestedTests test3; | ||||
if (QTest::qExec(&test3) != 0) { | if (QTest::qExec(&test3) != 0) { | ||||
fInvalid = true; | fInvalid = true; | ||||
Show All 28 Lines |