1 minor finding · 4 suggestions
Findings
[minor] · Nested CTest discovery ignores the active build configuration
Under a multi-config generator on Qt 6.3+, nested discovery omits the active configuration and misses the warning properties, causing the warning-probe test to fail despite correct configuration of the component runner.
Location: test/qml/test_warnings.py:26 (head).
Details and suggested fix
check_ctest_console() runs discovery without -C, while its CMake registration passes the resolved binary but not $<CONFIG>. Multi-config generators place NAME-form tests and their properties inside configuration-specific blocks, so discovery selects the fallback without the configured warning regex and environment. Reading test["properties"] can then fail, or the console-startup probe passes when the script expects CTest to reject it. Forward $<CONFIG> to the script and select it during discovery, retaining the existing behavior when the configuration is empty. No multi-config build of this app was found or run; the documented defaults and CI use single-config builds.
Optional improvements
[suggestion] · Warning probes resolve CTest through PATH
The warning-probe script can fail independently of the warning policy when PATH lacks CTest or selects an older installation than the one used for the build.
Location: test/qml/test_warnings.py:47 (head).
Details and suggested fix
Both discovery and console-probe execution launch the bare name ctest. A developer invoking an IDE-bundled or explicitly located CTest can therefore reach this script successfully but have its nested calls fail with FileNotFoundError or an unsupported-option error. In particular, the script requires --test-dir, available since CTest 3.20. Pass ${CMAKE_CTEST_COMMAND} from the test registration and use that executable in both subprocess calls. The checked-in CI installs CMake through apt and does not require this separate lookup.
[suggestion] · New component tests can silently omit warning enforcement
All current component tests re-arm warning failures, but no check protects that convention, so a future test file that omits the call can let non-QML Qt warnings pass on Qt 6.3+.
Location: test/qml/qml_tests_main.cpp:4384 (head).
Details and suggested fix
Qt Test clears the warning policy after each function, making each file's init() call to testSetup.failOnWarnings() necessary. All 52 current tst_*.qml files comply. Without that call, the persistent engine observer still catches engine warnings and CTest still catches qml-category console messages, but other Qt warnings can pass. The regression script only executes warning_probe.qml, so it cannot detect an omitted call in another file. Add a small source check for the required call in component-test initialization to protect the convention without changing existing test behavior.
[suggestion] · Warning probes never exercise per-test re-arming
Every warning probe runs one function in a fresh process, so the assertions would still pass if warning enforcement were installed only once per process.
Location: test/qml/test_warnings.py:68 (head).
Details and suggested fix
A first-call-only regression would still arm the policy for the isolated console probe. The binding, startup, and teardown probes would continue failing through the persistent engine-warning hook, leaving the loss of enforcement for later functions undetected. In the full suite, that gap would allow non-QML Qt warnings after the first function. Add a direct invocation selecting WarningProbe::test_clean followed by WarningProbe::test_console in the same process. Require the console diagnostic and a nonzero exit on Qt 6.3+, and exit zero on Qt 6.2. Without CTest's regex around this direct invocation, the later console warning tests re-arming itself. Keep the isolated startup and teardown probes.
[suggestion] · Expected engine warnings still fail the runner
On Qt 6.3+, accepting an engine warning through ignoreWarning() cannot prevent the executable from failing, even when all Qt Test assertions pass.
Location: test/qml/qml_tests_main.cpp:4436 (head).
Details and suggested fix
The engine-warning observer runs during test functions as well as loading and teardown. Every emission sets m_had_warnings, and main() converts an otherwise successful run into EXIT_FAILURE, independently of Qt Test's expected-warning handling. A negative test using ignoreWarning() for an engine diagnostic can therefore report passing assertions while the process fails with an Unexpected QML warning: message. No current ignoreWarning() or ignoreMessage() callers, or qmlWarning producers, were found. Preserve the intended strict policy, but explicitly document in the hook comment and component-test README that it applies in every phase and cannot be suppressed with ignoreWarning().