2022-03-10 18:49:42 +00:00
|
|
|
#include <QtQuickTest/quicktest.h>
|
|
|
|
#include <QQmlEngine>
|
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
#include <QtWebEngine>
|
|
|
|
|
2023-12-21 13:46:09 +00:00
|
|
|
#include <TestHelpers/MonitorQtOutput.h>
|
|
|
|
#include <TestHelpers/modelaccessobserverproxy.h>
|
2022-03-21 11:04:11 +00:00
|
|
|
|
2024-10-11 15:14:21 +00:00
|
|
|
#include <StatusQ/typesregistration.h>
|
|
|
|
|
2023-11-15 21:26:12 +00:00
|
|
|
class RunBeforeQApplicationIsInitialized {
|
|
|
|
public:
|
|
|
|
RunBeforeQApplicationIsInitialized()
|
|
|
|
{
|
|
|
|
QtWebEngine::initialize();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static RunBeforeQApplicationIsInitialized runBeforeQApplicationIsInitialized;
|
|
|
|
|
2022-03-10 18:49:42 +00:00
|
|
|
class TestSetup : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void qmlEngineAvailable(QQmlEngine *engine)
|
|
|
|
{
|
2023-04-14 08:18:56 +00:00
|
|
|
engine->addImportPath(QStringLiteral(STATUSQ_MODULE_IMPORT_PATH));
|
|
|
|
engine->addImportPath(QStringLiteral(QUICK_TEST_SOURCE_DIR) + "/qml/");
|
|
|
|
|
2022-03-21 11:04:11 +00:00
|
|
|
// TODO: Alternative to not yet supported QML_ELEMENT
|
|
|
|
qmlRegisterType<MonitorQtOutput>("StatusQ.TestHelpers", 0, 1, "MonitorQtOutput");
|
2023-12-19 15:24:31 +00:00
|
|
|
qmlRegisterType<ModelAccessObserverProxy>("StatusQ.TestHelpers", 0, 1, "ModelAccessObserverProxy");
|
2024-10-11 15:14:21 +00:00
|
|
|
|
|
|
|
registerStatusQTypes();
|
2022-03-10 18:49:42 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-09-15 08:53:32 +00:00
|
|
|
QUICK_TEST_MAIN_WITH_SETUP(TestStatusQ, TestSetup)
|
2022-03-10 18:49:42 +00:00
|
|
|
|
|
|
|
#include "main.moc"
|