2022-12-06 12:15:15 +00:00
|
|
|
#include <QQmlEngine>
|
2023-11-09 11:21:56 +00:00
|
|
|
#include <QtQuickTest>
|
|
|
|
|
2022-12-13 16:18:02 +00:00
|
|
|
#include "src/TextUtils.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,...
|
2024-05-28 17:39:41 +00:00
|
|
|
|
|
|
|
QGuiApplication::setOrganizationName(QStringLiteral("Status"));
|
|
|
|
QGuiApplication::setOrganizationDomain(QStringLiteral("status.im"));
|
|
|
|
|
2022-12-06 12:15:15 +00:00
|
|
|
const QStringList additionalImportPaths {
|
2023-04-14 08:18:56 +00:00
|
|
|
STATUSQ_MODULE_IMPORT_PATH,
|
2022-12-06 12:15:15 +00:00
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/../ui/app"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/../ui/imports"),
|
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/stubs"),
|
2023-10-10 13:42:50 +00:00
|
|
|
QML_IMPORT_ROOT + QStringLiteral("/src")
|
2022-12-06 12:15:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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-11-09 11:21:56 +00:00
|
|
|
|
|
|
|
QStandardPaths::setTestModeEnabled(true);
|
2024-01-04 12:05:54 +00:00
|
|
|
|
|
|
|
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
|
2022-12-06 12:15:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
QUICK_TEST_MAIN_WITH_SETUP(QmlTests, Setup)
|
|
|
|
|
|
|
|
#include "main.moc"
|