Make tests more platform agnostic (#4650)
Use QTemporaryDir to create the test directory Add option to use httpbin over local docker Increase delay for opening a connection Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <QApplication>
|
||||
#include <QtConcurrent>
|
||||
#include <QTemporaryDir>
|
||||
|
||||
using namespace chatterino;
|
||||
|
||||
@@ -12,12 +13,15 @@ int main(int argc, char **argv)
|
||||
|
||||
::benchmark::Initialize(&argc, argv);
|
||||
|
||||
// Ensure settings are initialized before any tests are run
|
||||
chatterino::Settings settings("/tmp/c2-empty-mock");
|
||||
// Ensure settings are initialized before any benchmarks are run
|
||||
QTemporaryDir settingsDir;
|
||||
settingsDir.setAutoRemove(false); // we'll remove it manually
|
||||
chatterino::Settings settings(settingsDir.path());
|
||||
|
||||
QtConcurrent::run([&app] {
|
||||
QtConcurrent::run([&app, &settingsDir]() mutable {
|
||||
::benchmark::RunSpecifiedBenchmarks();
|
||||
|
||||
settingsDir.remove();
|
||||
app.exit(0);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user