2026-05-03 21:02:30 +02:00
|
|
|
// QML unit-test runner. Bootstraps the Qt Quick Test framework against
|
|
|
|
|
// the `tst_*.qml` files in this directory. Invoked via CMake's
|
|
|
|
|
// `qmltest` test target (CTest) or directly via the produced exe.
|
|
|
|
|
//
|
|
|
|
|
// PLAN.md §13 v0.2.0 testing-strategy row.
|
|
|
|
|
|
2026-05-05 19:19:56 +02:00
|
|
|
#include <QtPlugin>
|
2026-05-03 21:02:30 +02:00
|
|
|
#include <QtQuickTest/quicktest.h>
|
|
|
|
|
|
2026-05-05 19:19:56 +02:00
|
|
|
// Static QML modules need their auto-generated plugin classes pulled
|
|
|
|
|
// in explicitly — the linker would otherwise strip the registration
|
|
|
|
|
// init code because nothing in main() references it. Without these
|
|
|
|
|
// imports the QmlEngine that QUICK_TEST_MAIN spins up can't resolve
|
|
|
|
|
// `import PhpQml.Bridge` / `import PhpQml.Bridge.Tests`.
|
|
|
|
|
//
|
|
|
|
|
// Plugin class names are auto-generated by qt_add_qml_module(STATIC)
|
|
|
|
|
// from the URI: dots become underscores, suffixed with "Plugin".
|
|
|
|
|
Q_IMPORT_PLUGIN(PhpQml_BridgePlugin)
|
|
|
|
|
Q_IMPORT_PLUGIN(PhpQml_Bridge_TestsPlugin)
|
|
|
|
|
|
2026-05-03 21:02:30 +02:00
|
|
|
QUICK_TEST_MAIN(qml_unit_tests)
|