cxx-qt
cxx-qt copied to clipboard
Investigate why qmltestrunner tests fail on macOS in CI
We currently need to disable example_qml_extension_plugin_test
tests on macOS as it fails to import QtQuick module.
I suspect this is a bug in qmltestrunner
when statically linked to Qt.
After removing the qmltestrunner dependency in #453, the macOS test runner still fails, with this error:
qt.core.plugin.loader: Cannot load '/Users/runner/cxx-qt/build/examples/qml_extension_plugin/qml/com/kdab/cxx_qt/demo/libcore_qmlplugin.dylib' into a statically linked Qt library.
********* Start testing of qml_extension_plugin *********
Config: Using QtTest library 6.4.2, Qt 6.4.2 (x86_64-little_endian-lp64 static release build; by Apple LLVM 13.0.0 (clang-1300.0.29.30)), macos 11.7
QWARN : qml_extension_plugin::tst_myobject::compile()
/Users/runner/cxx-qt/examples/qml_extension_plugin/tests/tst_myobject.qml produced 1 error(s):
/Users/runner/cxx-qt/examples/qml_extension_plugin/tests/tst_myobject.qml:9,1: Unknown error
Working directory: /Users/runner/cxx-qt/build/examples/qml_extension_plugin/tests
Import paths:
'/Users/runner/cxx-qt/build/examples/qml_extension_plugin/qml'
'/Users/runner/cxx-qt/build/examples/qml_extension_plugin/tests'
'qrc:/qt-project.org/imports'
Plugin paths:
'.'
FAIL! : qml_extension_plugin::tst_myobject::compile() Unknown error
Loc: [/Users/runner/cxx-qt/examples/qml_extension_plugin/tests/tst_myobject.qml(9)]
Totals: 0 passed, 1 failed, 0 skipped, 0 blacklisted, 1ms
It seems the root cause is that a statically linked Qt can't load any plugins! Which means we would have to test this by dynamically linking to Qt. Probably not worth it to change the CI build process just for this though. What do you think @Be-ing ?