Don't run tests on unsupported frontends

If kddw wasn't compiled with QtQuick support then don't run the
QtQuick tests.
This commit is contained in:
Sergio Martins
2022-05-28 16:06:17 +01:00
parent 1c0c594abe
commit f645a4345f
2 changed files with 8 additions and 7 deletions

View File

@@ -69,9 +69,7 @@ Q_ENUM_NS(MainWindowOptions)
enum class FrontendType
{
QtWidgets = 1,
QtQuick,
FIRST = QtWidgets,
LAST = QtQuick // keep pointing to last
QtQuick
};
Q_ENUM_NS(FrontendType)

View File

@@ -119,10 +119,13 @@ void Platform::tests_deinitPlatform()
std::vector<KDDockWidgets::FrontendType> Platform::frontendTypes()
{
std::vector<KDDockWidgets::FrontendType> types;
types.reserve(int(FrontendType::LAST));
for (int i = int(FrontendType::FIRST); i <= int(FrontendType::LAST); ++i) {
types.push_back(FrontendType(i));
}
#ifdef KDDW_FRONTEND_QTWIDGETS
types.push_back(FrontendType::QtWidgets);
#endif
#ifdef KDDW_FRONTEND_QTQUICK
types.push_back(FrontendType::QtQuick);
#endif
return types;
}