qt-qml-test-run

Builds and runs Qt Quick Test suites and writes structured Markdown reports.

1|Updated Jul 12, 2026
One-click install
npx skills add https://github.com/TypeThe0ry/Multi-Detect --skill qt-qml-test-run-typethe0ry
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: qt-qml-test-run
Source: https://github.com/TypeThe0ry/Multi-Detect/tree/main/ground-control/MultiDetectGCS/tools/skills/qt-qml-test-run
Command: npx skills add https://github.com/TypeThe0ry/Multi-Detect --skill qt-qml-test-run-typethe0ry

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Running Qt Quick Test (qmltestrunner) suites in a Qt 6 / CMake project involves locating the Qt toolchain, wiring up CMake test infrastructure, building, executing tests, and interpreting JUnit XML output — a repetitive, error-prone process this Skill automates end to end. ## Core Features & Use Cases - Toolchain and test discovery: Resolves qmltestrunner from CLAUDE.md, environment variables, PATH, or common install roots on Linux, macOS, and Windows, then discovers tst_.qml files automatically. - Opt-in CMake wiring: With --wire-up, generates tests/CMakeLists.txt and tests/main.cpp (QUICK_TEST_MAIN_WITH_SETUP harness) and proposes root CMakeLists.txt changes only after explicit user confirmation; otherwise falls back to direct qmltestrunner invocation with zero file modifications. - Structured reporting: Parses JUnit XML with a bundled Python script and writes a timestamped Markdown report with summary, failed tests, slowest tests, skipped tests, and source changes since the prior run. - Use Case: A developer adds QML tests to a Qt 6 application and asks the assistant to run them; the Skill detects missing test wiring, runs qmltestrunner directly, and produces a pass/fail report with the 10 slowest cases. ## Quick Start Ask the assistant to run the QML tests in your project, optionally passing a path to a tst_.qml file or test directory and flags like --wire-up or --no-build.

Frequently Asked Questions about qt-qml-test-run

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run qmltestrunner tests in a Qt 6 CMake project?▼

Invoke the Skill with an optional path to a tst_*.qml file or test directory. It locates qmltestrunner, detects existing CMake test wiring, builds the project, runs the test binary or qmltestrunner directly, and writes a Markdown report under build/tests/reports/.

How do I add Qt Quick Test infrastructure to a CMake project?▼

Re-invoke with --wire-up after reviewing the printed recipe. The Skill writes tests/CMakeLists.txt and tests/main.cpp using QUICK_TEST_MAIN_WITH_SETUP, then proposes a three-line root CMakeLists.txt addition applied only after your explicit confirmation.

Does qmltestrunner work with static QML modules?▼

No. When qt_add_qml_module backs a STATIC library, the generated plugin is also static and cannot be dlopened, so imports fail with module not installed. The Skill detects this case and routes directly to CMake wire-up with a custom test executable.

Why does ctest --output-junit report only one test case?▼

CTest aggregates JUnit output at the CTest-target level, collapsing all QML test functions into a single testcase entry. The Skill invokes the built test binary directly with -o report.xml,junitxml to get per-function granularity.

Can Qt Quick Tests run headless without a display?▼

Yes. Prepend QT_QPA_PLATFORM=offscreen to the test binary or qmltestrunner invocation, or append -platform offscreen to the runner arguments. Do not pass -platform through ctest, since it does not forward arguments to test binaries.

What are the limitations of this QML test runner?▼

It supports only CMake-based Qt 6 projects, not qmake, and excludes cross-compiled or on-device test runs, C++ Qt Test (QTEST_MAIN), Squish, and in-IDE integrations. Authoring tst_*.qml files is handled by the separate qt-qml-test skill.