mirror-chatterino2/benchmarks/src/main.cpp

30 lines
694 B
C++
Raw Normal View History

#include "singletons/Settings.hpp"
#include <benchmark/benchmark.h>
#include <QApplication>
#include <QtConcurrent>
#include <QTemporaryDir>
using namespace chatterino;
int main(int argc, char **argv)
{
QApplication app(argc, argv);
::benchmark::Initialize(&argc, argv);
// Ensure settings are initialized before any benchmarks are run
QTemporaryDir settingsDir;
settingsDir.setAutoRemove(false); // we'll remove it manually
chatterino::Settings settings(settingsDir.path());
2023-06-24 15:03:27 +02:00
QTimer::singleShot(0, [&]() {
::benchmark::RunSpecifiedBenchmarks();
settingsDir.remove();
2023-06-24 15:03:27 +02:00
QApplication::exit(0);
});
2023-06-24 15:03:27 +02:00
return QApplication::exec();
}