2022-08-13 12:36:41 +03:00
|
|
|
//#
|
2023-12-31 09:24:12 +01:00
|
|
|
//# Copyright (C) 2020-2024 QuasarApp.
|
2022-08-13 12:36:41 +03:00
|
|
|
//# Distributed under the GPLv3 software license, see the accompanying
|
|
|
|
//# Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
//# of this license document, but changing it is not allowed.
|
|
|
|
//#
|
|
|
|
|
|
|
|
|
|
|
|
#include "qmlextracttest.h"
|
2022-10-26 10:26:40 +03:00
|
|
|
#include "qmlqt5.h"
|
2022-08-13 20:34:51 +03:00
|
|
|
#include "qmlcreator.h"
|
2022-08-13 12:36:41 +03:00
|
|
|
#include <configparser.h>
|
|
|
|
#include <dependenciesscanner.h>
|
|
|
|
#include <filemanager.h>
|
|
|
|
#include <packing.h>
|
|
|
|
#include <pluginsparser.h>
|
|
|
|
|
|
|
|
|
|
|
|
void QMLExtractTest::test() {
|
|
|
|
QmlCreator creator("./");
|
|
|
|
auto imports = creator.getQmlImports();
|
|
|
|
|
|
|
|
auto qmlFiles = creator.getCopyedQml();
|
|
|
|
|
|
|
|
|
2022-10-26 10:26:40 +03:00
|
|
|
QMLQt5 scaner("./");
|
2022-08-13 12:36:41 +03:00
|
|
|
|
|
|
|
|
2023-11-04 23:58:04 +01:00
|
|
|
for (const auto &file : std::as_const(qmlFiles)) {
|
2022-08-13 12:36:41 +03:00
|
|
|
|
|
|
|
|
|
|
|
auto fileImports = scaner.extractImportsFromFile(file);
|
|
|
|
|
|
|
|
for (const auto &fil : imports.value(file)) {
|
|
|
|
QVERIFY(fileImports.contains(fil, Qt::CaseInsensitive));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|