mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
0177ab4829
Also rework HighlightController test directory creation/saving to ensure the test directory is written to & cleaned up appropriately
46 lines
985 B
C++
46 lines
985 B
C++
#include "common/NetworkManager.hpp"
|
|
#include "common/NetworkRequest.hpp"
|
|
#include "common/NetworkResult.hpp"
|
|
#include "common/Outcome.hpp"
|
|
#include "common/QLogging.hpp"
|
|
#include "providers/twitch/api/Helix.hpp"
|
|
#include "singletons/Settings.hpp"
|
|
|
|
#include <gtest/gtest.h>
|
|
#include <QApplication>
|
|
#include <QJsonArray>
|
|
#include <QtConcurrent>
|
|
#include <QTimer>
|
|
|
|
#include <chrono>
|
|
#include <thread>
|
|
|
|
using namespace chatterino;
|
|
|
|
#define SUPPORT_QT_NETWORK_TESTS
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
#ifdef SUPPORT_QT_NETWORK_TESTS
|
|
QApplication app(argc, argv);
|
|
|
|
chatterino::NetworkManager::init();
|
|
|
|
// Ensure settings are initialized before any tests are run
|
|
chatterino::Settings settings("/tmp/c2-empty-test");
|
|
|
|
QtConcurrent::run([&app] {
|
|
auto res = RUN_ALL_TESTS();
|
|
|
|
chatterino::NetworkManager::deinit();
|
|
|
|
app.exit(res);
|
|
});
|
|
|
|
return app.exec();
|
|
#else
|
|
return RUN_ALL_TESTS();
|
|
#endif
|
|
}
|