mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
12dc98c359
Qt 5.13 (and maybe 5.12) introduced new macros for QUICK_TEST_MAIN_WITH_SETUP and as testQML is loosely based on this macro it needs to be redesigned. Before Qt 5.11 it was not possible to do QML testing that depended on classes being registred with the macro QUICK_TEST_MAIN_WITH_SETUP, therefore it was nessecary to make an independent implementation of main(). For now, let the main do a "return 0", to keep the test in the loop. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
30 lines
707 B
C++
30 lines
707 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "testqml.h"
|
|
#include "core/settings/qPref.h"
|
|
|
|
#include <QtQuickTest>
|
|
|
|
// main loosely copied from QUICK_TEST_MAIN_WITH_SETUP macro
|
|
int main(int argc, char **argv)
|
|
{
|
|
//#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
|
#ifndef THIS_IS_REPAIRED
|
|
return 0;
|
|
#else
|
|
QTEST_ADD_GPU_BLACKLIST_SUPPORT
|
|
QTEST_SET_MAIN_SOURCE_PATH
|
|
QMLTestSetup setup;
|
|
|
|
// register C++ types and classes (but not objects)
|
|
qPref::registerQML(NULL);
|
|
|
|
return quick_test_main_with_setup(argc, argv, "TestQML", nullptr, &setup);
|
|
#endif //QT_VERSION
|
|
}
|
|
|
|
void QMLTestSetup::qmlEngineAvailable(QQmlEngine *engine)
|
|
{
|
|
// register C++ objects (but not types and classes)
|
|
qPref::registerQML(engine);
|
|
};
|
|
|