mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
feat: add C++ language support and hook tests (#539)
- agents: cpp-build-resolver, cpp-reviewer - commands: cpp-build, cpp-review, cpp-test - rules: cpp/ (coding-style, hooks, patterns, security, testing) - tests: 9 new hook test files with comprehensive coverage Cherry-picked from PR #436.
This commit is contained in:
44
rules/cpp/testing.md
Normal file
44
rules/cpp/testing.md
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
paths:
|
||||
- "**/*.cpp"
|
||||
- "**/*.hpp"
|
||||
- "**/*.cc"
|
||||
- "**/*.hh"
|
||||
- "**/*.cxx"
|
||||
- "**/*.h"
|
||||
- "**/CMakeLists.txt"
|
||||
---
|
||||
# C++ Testing
|
||||
|
||||
> This file extends [common/testing.md](../common/testing.md) with C++ specific content.
|
||||
|
||||
## Framework
|
||||
|
||||
Use **GoogleTest** (gtest/gmock) with **CMake/CTest**.
|
||||
|
||||
## Running Tests
|
||||
|
||||
```bash
|
||||
cmake --build build && ctest --test-dir build --output-on-failure
|
||||
```
|
||||
|
||||
## Coverage
|
||||
|
||||
```bash
|
||||
cmake -DCMAKE_CXX_FLAGS="--coverage" -DCMAKE_EXE_LINKER_FLAGS="--coverage" ..
|
||||
cmake --build .
|
||||
ctest --output-on-failure
|
||||
lcov --capture --directory . --output-file coverage.info
|
||||
```
|
||||
|
||||
## Sanitizers
|
||||
|
||||
Always run tests with sanitizers in CI:
|
||||
|
||||
```bash
|
||||
cmake -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined" ..
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
See skill: `cpp-testing` for detailed C++ testing patterns, TDD workflow, and GoogleTest/GMock usage.
|
||||
Reference in New Issue
Block a user