qt-test-fixture-generator

Generate QTest fixtures, mock QObjects, and CMake test targets for Qt C++ classes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/rghamilton3/mission-control-rack --skill qt-test-fixture-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: qt-test-fixture-generator
Source: https://github.com/rghamilton3/mission-control-rack/tree/main/.claude/skills/qt-test-fixture-generator
Command: npx skills add https://github.com/rghamilton3/mission-control-rack --skill qt-test-fixture-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the repetitive and error-prone work of writing Qt tests by generating complete QTest fixtures, mock QObjects, data-driven providers, and CMake test integration so developers can focus on behavior rather than setup.

Core Features & Use Cases

  • QTest fixture generation: Produces test classes with lifecycle hooks, data providers, and benchmark slots for targeted verification.
  • Mock QObjects with signals/slots: Generates mock classes that track calls, emit signals, and provide configurable return values for dependency isolation.
  • CMake & CI integration: Adds test executables, registers tests with CTest, and can enable coverage compilation for CI pipelines.
  • Use Case: Rapidly scaffold unit and GUI tests for a widget class (e.g., MyWidget) with data-driven test rows, signal verification, and mocked services.

Quick Start

Generate a complete QTest fixture for class MyWidget in /path/to/qt-project with mocked dependencies and CMake test registration.

Frequently Asked Questions about qt-test-fixture-generator

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

FAQPage Schema
How do I generate Qt test fixtures and mock QObjects for C++ classes?

To generate Qt test fixtures and mock QObjects, you provide your Qt C++ class to the generator. It produces complete QTest test classes, mock implementations with signal/slot behavior, and CMake test targets for unit, integration, and GUI testing.

Can I create data-driven tests with QFETCH using this Qt test generator?

Yes, you can create data-driven tests using QFETCH. The generator produces QTest data providers that populate test rows, allowing you to verify targeted behavior across multiple input scenarios for your Qt C++ classes.

Does this tool integrate Qt unit tests with CMake and CTest for CI pipelines?

Yes, this tool integrates Qt unit tests with CMake and CTest for CI pipelines. It automatically adds test executables, registers them with CTest, and can enable coverage compilation flags to support continuous integration workflows.

How do I mock Qt signals and slots to isolate dependencies in unit tests?

To mock Qt signals and slots for dependency isolation, the generator creates mock QObject classes. These mocks track method calls, emit configured signals, and provide customizable return values for targeted verification.

What is the best way to scaffold QTest benchmark tests for a Qt widget?

The best way to scaffold QTest benchmark tests for a Qt widget is using an automated fixture generator. It produces test classes with benchmark slots and lifecycle hooks, letting you focus on measuring behavior rather than writing setup code.

Can I use this to generate GUI tests for Qt widget classes?

Yes, you can use this to generate GUI tests for Qt widget classes. The generator scaffolds QTest fixtures specifically for GUI testing, including mocked services and signal verification to validate widget behavior.