/qt-suite:generate [optional: specific file or class to generate tests for]from qt-suite
Generates unit tests for Qt/PySide6 source files — scans the project for untested files or targets a specific file/class, then writes pytest or QTest files following project conventions.
Ships in qt-suite. Installing the plugin adds it to Claude Code.
Generate unit tests for this Qt project. When an argument is provided, generate tests for that specific file or class. When no argument is provided, scan the project to identify the files most in need of tests.
If an argument was provided (e.g., /qt-suite:generate src/calculator.py):
If no argument was provided:
.qt-test.json if present to determine project_type and test_dirCMakeLists.txt (C++) or pyproject.toml/setup.cfg (Python)**/*.py (excluding tests/, __init__.py, migration files)**/*.cpp and **/*.h (excluding tests/, moc_*, ui_*, build/)tests/test_<module>.py for src/<module>.pytests/<name>_test.cpp or tests/test_<name>.cpp for src/<name>.cppRead the target source file completely. Identify:
If a test file already exists for this source:
Python projects:
tests/test_<module_name>.pyQWidget/QDialog/etc. → use qtbot fixtureC++ projects:
tests/<ClassName>Test.cpp (or tests/test_<name>.cpp)QObject subclass with Q_OBJECT macroQTEST_MAIN(TestClassName) and #include "<file>.moc"QML:
tests/tst_<ComponentName>.qmlTestCase itemWrite comprehensive tests targeting:
QSignalSpy in C++, waitSignal/waitSignals in pytest-qt)Reference the qtest-patterns skill for correct syntax and patterns.
For pytest-qt tests, always use qtbot.addWidget() for any widget created in a test. For QTest C++ tests, use init() / cleanup() slots for per-test setup/teardown.
Write the test file to the determined location. If the file already exists, append new test classes/functions — never overwrite existing tests.
Report concisely:
tests/test_calculator.pypytest tests/test_calculator.py -v (Python) or cmake --build build && ctest -R TestCalculator (C++)What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
6 commands in this plugin
/coverageRun coverage analysis for the Qt project. Instruments the build, executes tests, generates an HTML report, identifies coverage gaps, and optionally triggers the test-generator agent to fill them./new-componentGenerate a new Qt widget, dialog, or window class with correct boilerplate and object names./runBuild and run the Qt project's test suite. Auto-detects Python (pytest) vs C++ (CMake + CTest) and reports results with a pass/fail summary.npx claudepluginhub l3digitalnet/claude-code-plugins --plugin qt-suiteOther plugins' commands for the same job