2016-08-20 11:19:35 +02:00
|
|
|
// Copyright (c) 2009-2016 The Bitcoin Core developers
|
2014-09-05 13:11:11 +02:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2013-12-11 15:00:56 +01:00
|
|
|
#if defined(HAVE_CONFIG_H)
|
2014-06-23 20:04:24 +02:00
|
|
|
#include "config/bitcoin-config.h"
|
2013-12-11 15:00:56 +01:00
|
|
|
#endif
|
|
|
|
|
2016-08-20 11:19:35 +02:00
|
|
|
#include "chainparams.h"
|
|
|
|
#include "rpcnestedtests.h"
|
2015-03-27 01:33:34 +01:00
|
|
|
#include "util.h"
|
2014-09-05 13:11:11 +02:00
|
|
|
#include "uritests.h"
|
2016-12-16 08:52:35 +01:00
|
|
|
#include "compattests.h"
|
2014-09-05 13:11:11 +02:00
|
|
|
|
2013-12-11 15:00:56 +01:00
|
|
|
#ifdef ENABLE_WALLET
|
2013-07-22 08:50:39 +02:00
|
|
|
#include "paymentservertests.h"
|
2013-12-11 15:00:56 +01:00
|
|
|
#endif
|
2013-04-13 07:13:08 +02:00
|
|
|
|
2013-11-14 19:21:16 +01:00
|
|
|
#include <QCoreApplication>
|
2013-04-13 07:13:08 +02:00
|
|
|
#include <QObject>
|
|
|
|
#include <QTest>
|
2013-07-22 08:50:39 +02:00
|
|
|
|
2015-01-20 13:35:13 +01:00
|
|
|
#include <openssl/ssl.h>
|
|
|
|
|
2013-12-18 21:46:48 +01:00
|
|
|
#if defined(QT_STATICPLUGIN) && QT_VERSION < 0x050000
|
|
|
|
#include <QtPlugin>
|
|
|
|
Q_IMPORT_PLUGIN(qcncodecs)
|
|
|
|
Q_IMPORT_PLUGIN(qjpcodecs)
|
|
|
|
Q_IMPORT_PLUGIN(qtwcodecs)
|
|
|
|
Q_IMPORT_PLUGIN(qkrcodecs)
|
|
|
|
#endif
|
|
|
|
|
2016-08-20 11:19:35 +02:00
|
|
|
extern void noui_connect();
|
|
|
|
|
2013-07-22 08:50:39 +02:00
|
|
|
// This is all you need to run all the tests
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2015-03-27 01:33:34 +01:00
|
|
|
SetupEnvironment();
|
2016-08-20 11:19:35 +02:00
|
|
|
SetupNetworking();
|
|
|
|
SelectParams(CBaseChainParams::MAIN);
|
|
|
|
noui_connect();
|
|
|
|
|
2013-07-22 08:50:39 +02:00
|
|
|
bool fInvalid = false;
|
|
|
|
|
2013-11-14 19:21:16 +01:00
|
|
|
// Don't remove this, it's needed to access
|
|
|
|
// QCoreApplication:: in the tests
|
|
|
|
QCoreApplication app(argc, argv);
|
|
|
|
app.setApplicationName("Bitcoin-Qt-test");
|
|
|
|
|
2015-01-20 13:35:13 +01:00
|
|
|
SSL_library_init();
|
|
|
|
|
2013-07-22 08:50:39 +02:00
|
|
|
URITests test1;
|
|
|
|
if (QTest::qExec(&test1) != 0)
|
|
|
|
fInvalid = true;
|
2013-12-11 15:00:56 +01:00
|
|
|
#ifdef ENABLE_WALLET
|
2013-07-22 08:50:39 +02:00
|
|
|
PaymentServerTests test2;
|
|
|
|
if (QTest::qExec(&test2) != 0)
|
|
|
|
fInvalid = true;
|
2013-12-11 15:00:56 +01:00
|
|
|
#endif
|
2016-08-20 11:19:35 +02:00
|
|
|
RPCNestedTests test3;
|
|
|
|
if (QTest::qExec(&test3) != 0)
|
|
|
|
fInvalid = true;
|
2016-12-16 08:52:35 +01:00
|
|
|
CompatTests test4;
|
|
|
|
if (QTest::qExec(&test4) != 0)
|
|
|
|
fInvalid = true;
|
2013-07-22 08:50:39 +02:00
|
|
|
|
|
|
|
return fInvalid;
|
|
|
|
}
|