Loading...
Searching...
No Matches
score-lib-device/Tests/Utils.hpp
1#pragma once
2
3#include <State/Message.hpp>
4
6
7#include <core/application/MinimalApplication.hpp>
8#include <core/application/MockApplication.hpp>
9
10#include <ossia/network/domain/domain.hpp>
11
12#include <QMetaType>
13#include <QObject>
14
15#include <catch2/reporters/catch_reporter_event_listener.hpp>
16#include <catch2/reporters/catch_reporter_registrars.hpp>
17
18// Qt6: QDataStream stream operators and comparators for registered metatypes
19// are picked up automatically (qRegisterMetaTypeStreamOperators /
20// QMetaType::registerComparators were removed).
21namespace
22{
23struct ScoreTestApplicationStarter final : Catch::EventListenerBase
24{
25 using Catch::EventListenerBase::EventListenerBase;
26 void testRunStarting(const Catch::TestRunInfo&) override
27 {
28#if !defined(__EMSCRIPTEN__)
29 if(!qEnvironmentVariableIsSet("QT_QPA_PLATFORM"))
30 qputenv("QT_QPA_PLATFORM", "offscreen");
31#endif
33 }
34};
35}
36CATCH_REGISTER_LISTENER(ScoreTestApplicationStarter)
Definition MinimalApplication.hpp:23