Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/test_main.cpp
Show All 25 Lines | |||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
#include <test/util/setup_common.h> | #include <test/util/setup_common.h> | ||||
#include <QApplication> | #include <QApplication> | ||||
#include <QObject> | #include <QObject> | ||||
#include <QTest> | #include <QTest> | ||||
#ifdef ENABLE_BIP70 | |||||
#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); | ||||
#elif defined(QT_QPA_PLATFORM_WINDOWS) | #elif defined(QT_QPA_PLATFORM_WINDOWS) | ||||
Show All 22 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 | |||||
// (at least on Darwin). | |||||
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; | ||||
} | } | ||||
Show All 35 Lines |