2020-12-26 12:42:39 +01:00
|
|
|
#include "common/NetworkManager.hpp"
|
|
|
|
#include "common/NetworkRequest.hpp"
|
|
|
|
#include "common/NetworkResult.hpp"
|
|
|
|
#include "common/Outcome.hpp"
|
|
|
|
#include "providers/twitch/api/Helix.hpp"
|
|
|
|
|
|
|
|
#include "common/Outcome.hpp"
|
|
|
|
#include "common/QLogging.hpp"
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include <QJsonArray>
|
|
|
|
#include <QtConcurrent>
|
|
|
|
|
|
|
|
#include <chrono>
|
|
|
|
#include <thread>
|
|
|
|
#include "common/NetworkManager.hpp"
|
|
|
|
|
2019-05-11 14:13:03 +02:00
|
|
|
#include <gtest/gtest.h>
|
2020-12-26 12:42:39 +01:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
using namespace chatterino;
|
|
|
|
|
2022-05-07 17:22:39 +02:00
|
|
|
#define SUPPORT_QT_NETWORK_TESTS
|
|
|
|
|
2020-12-26 12:42:39 +01:00
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
|
2022-05-07 17:22:39 +02:00
|
|
|
#ifdef SUPPORT_QT_NETWORK_TESTS
|
2020-12-26 12:42:39 +01:00
|
|
|
QApplication app(argc, argv);
|
|
|
|
|
|
|
|
chatterino::NetworkManager::init();
|
|
|
|
|
|
|
|
QtConcurrent::run([&app] {
|
|
|
|
auto res = RUN_ALL_TESTS();
|
|
|
|
|
|
|
|
chatterino::NetworkManager::deinit();
|
|
|
|
|
|
|
|
app.exit(res);
|
|
|
|
});
|
2019-05-11 14:13:03 +02:00
|
|
|
|
2020-12-26 12:42:39 +01:00
|
|
|
return app.exec();
|
2022-05-07 17:22:39 +02:00
|
|
|
#else
|
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
#endif
|
2020-12-26 12:42:39 +01:00
|
|
|
}
|