Create generate-unit-tests prompt for Google Test#1
Create generate-unit-tests prompt for Google Test#1kblricks wants to merge 1 commit intoSharedDevelopmentfrom
Conversation
Add a prompt for generating Google Test unit tests for Graphitti C++17 functions with guidelines for discovery, research, and output.
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Copilot prompt file to guide generation of Google Test unit tests for Graphitti C++17 code, with emphasis on discovery and planning before writing tests.
Changes:
- Introduces a new
.github/prompts/generate-unit-tests.prompt.mdprompt with discovery/research steps. - Defines a test plan checklist and output guidelines for produced Google Test code.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Test behavior, not implementation details | ||
| - Follow naming: `TEST(ClassName, Method_Condition_Expected)` | ||
| - Place new tests in `Testing/UnitTesting/{ClassName}Tests.cpp` |
There was a problem hiding this comment.
The suggested test naming TEST(ClassName, Method_Condition_Expected) uses underscores, which conflicts with the documented Graphitti GoogleTest convention of PascalCase for both suite and test names (no underscores). To keep generated tests consistent with the existing suite, update this guideline to use PascalCase examples (e.g., TEST(ClassName, FunctionalityBeingTested)).
| Target function: ${input:function_name:Which C++ function or method should be tested?} | ||
| Target class: ${input:class_name:Which class does this function belong to? (or 'standalone' for free functions)} | ||
|
|
There was a problem hiding this comment.
Target class can be 'standalone' for free functions, but the output guidance still assumes {ClassName} for suite naming and file placement. Please define what suite/file name should be used for free functions (e.g., a module name or dedicated FreeFunctions suite) so generation is unambiguous.
| - Place new tests in `Testing/UnitTesting/{ClassName}Tests.cpp` | ||
| - If updating an existing test file, add a brief comment marking new additions | ||
| - Include realistic Graphitti simulation data where appropriate |
There was a problem hiding this comment.
The instruction to "add a brief comment marking new additions" when updating an existing test file doesn't match existing unit test files in Testing/UnitTesting/, which generally don't annotate incremental additions. Consider removing this requirement (or making it conditional) to avoid creating unnecessary churn in diffs.
Add a prompt for generating Google Test unit tests for Graphitti C++17 functions with guidelines for discovery, research, and output.
Closes #
Description
Checklist (Mandatory for new features)
Testing (Mandatory for all changes)
test-medium-connected.xmlPassedtest-large-long.xmlPassed