2022-12-06 12:15:15 +00:00
|
|
|
#include <QtQuickTest/quicktest.h>
|
|
|
|
#include <QQmlEngine>
|
2022-12-13 16:18:02 +00:00
|
|
|
#include "src/TextUtils.h"
|
2022-12-06 12:15:15 +00:00
|
|
|
|
2023-03-01 12:46:56 +00:00
|
|
|
#include "StatusQ/typesregistration.h"
|
|
|
|
|
2022-12-06 12:15:15 +00:00
|
|
|
class Setup : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void qmlEngineAvailable(QQmlEngine *engine) {
|
|
|
|
// custom code that needs QQmlEngine, register QML types, add import paths,...
|
|
|
|
const QStringList additionalImportPaths {
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/../ui/StatusQ/src"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/../ui/app"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/../ui/imports"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/stubs"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/mocks"),
|
|
|
|
};
|
|
|
|
|
|
|
|
for (const auto& path : additionalImportPaths)
|
|
|
|
engine->addImportPath(path);
|
2022-12-13 16:18:02 +00:00
|
|
|
|
|
|
|
qmlRegisterSingletonType<TextUtils>("TextUtils", 1, 0, "TextUtils", &TextUtils::qmlInstance);
|
2023-03-01 12:46:56 +00:00
|
|
|
|
|
|
|
registerStatusQTypes();
|
2022-12-06 12:15:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
QUICK_TEST_MAIN_WITH_SETUP(QmlTests, Setup)
|
|
|
|
|
|
|
|
#include "main.moc"
|