c-testing
C testing workflow for unit and integration tests: deterministic harnesses, CMake/CTest execution strategy, sanitizer-first debugging, and fuzzing escalation. Use when writing or fixing tests for C (C11+) modules, stabilizing flaky suites, or reproducing memory/UB bugs.
v2026.11.13-21cd5683 instalações+3 em 7 dias39 EstrelasMITsincronizado há 11 horas
Instalar
Ainda não tem a CLI da NotHoly? Instale primeiro.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install aeondave/c-testingGrava em ~/.notholy/skills depois de conferir a assinatura e o SHA-256.
AssinaturaAssinado, ed25519
Pacote6bd0ec7f…ea7eb3f4
6bd0ec7fb13c…0bd8ea7eb3f45 arquivos · 6.1 KBVarreduraBaixo1 achado
- Links para domínios externos
Fontegithub.com/AeonDave/malskill/tree/main/coding/c-testing@21cd568
Este item ainda não foi escrito no seu idioma, então aparece em English.
Nesta página
Pragmatic workflow for reliable C tests and bug-finding.
When to activate
- Adding unit tests for C functions
- Building a small test harness around a module
- Debugging failing tests or memory corruption
- Enabling sanitizers or fuzzing to reproduce crashes
Core rules
- Keep unit tests deterministic and isolated.
- Avoid real network/time in unit tests.
- Run ASan/UBSan in CI for memory and UB signal.
- Reproduce failures in the smallest possible command first.
- Do not hide memory/UB bugs behind test-only flags, retries, or inflated timeouts.
- Pair with
test-driven-developmentwhen implementing persistent code or bug fixes test-first. - Pair with
testing-reliabilityfor fixture/timing anti-patterns andsystematic-debuggingwhen the root cause is unclear.
Recommended workflow
Phase 1 — Reproduce with smallest scope
- Run the single failing test first (
ctest -R ...or direct binary invocation). - Capture exact command, seed/input, and environment variables.
- Eliminate unrelated test noise before debugging.
Phase 2 — Strengthen harness determinism
- Keep each test independent (no shared mutable global state).
- Use explicit fixtures/setup-teardown for temp files and state reset.
- Prefer table-driven tests for parsers and boundary-heavy functions.
Phase 3 — Sanitizer-first diagnosis
- Run AddressSanitizer for memory corruption/UAF/OOB.
- Run UndefinedBehaviorSanitizer for integer/shift/null/alignment UB.
- Use stack-symbolized reports before stepping into debugger.
Phase 4 — CTest execution strategy
- Label tests (
unit,integration,slow,flaky) and run by label. - Use
--output-on-failureand--rerun-failedin local loops. - Add per-test
TIMEOUTto avoid hanging pipelines.
Phase 5 — Fuzzing escalation
- Add libFuzzer target for parser/decoder/validator style APIs.
- Seed corpus with valid and invalid minimal inputs.
- Keep fuzz target stateless, deterministic, and side-effect free.
Fast triage checklist
- Single failing test reproduced in isolation.
- Failure reproduced under sanitizer build (if memory/UB suspected).
- Backtrace/symbolization points to root cause function.
- Regression test added for the fixed bug.
- Full suite rerun (or label-targeted suite if justified) with no new failures.
Resources
Load on demand:
references/harness.md— harness structure, assertions, Unity/cmocka optionsreferences/cmake-ctest.md— CMake/CTest patterns, labels, sanitizer presets, MinGW cross-compilereferences/sanitizers-fuzzing.md— ASan/UBSan usage and a minimal fuzz target outlinereferences/debugging.md— gdb/lldb, Valgrind, MinGW objdump/nm, MSVC dumpbin/WinDbg, ASan env vars
Arquivos desta versão
references/411.4 KB
- cmake-ctest.md2.7 KB
- debugging.md3.5 KB
- harness.md3.4 KB
- sanitizers-fuzzing.md1.8 KB
- SKILL.md3.3 KB
Permissões
| Permissão | Declarada | Encontrada na varredura |
|---|---|---|
| Lê arquivos | Não | Não |
| Grava arquivos | Não | Não |
| Roda comandos no shell | Sim | Sim |
| Usa a rede | Sim | Sim |
| Usa conectores | Não | Não |
| Controla um navegador | Não | Não |
Achados da varredura
Revisado em 13 de nov. de 2026
- InfoLink · Links para domínios externos
Uma varredura limpa reduz o risco, mas não prova que o pacote é seguro. Leia o que você instala.
| Versão | Publicada em | Commit | SHA-256 | Assinatura | Mudança de permissão |
|---|---|---|---|---|---|
| v2026.11.13-21cd568 | 13 de nov. de 2026 | 21cd568 | 6bd0ec7f | Assinada | – |
Mais de AeonDave
Tudo deste publicadorMais em Engenharia reversa e fuzzing
Ver a categoriaPergunte tudo o que o seu escopo permite.
Crie a conta, adicione créditos e faça a primeira pergunta no chat ou no terminal.
- 1/3
Crie a conta
Individual ou empresa. Dá para virar empresa depois sem perder saldo nem chaves.
Pessoa físicaEmpresa - 2/3
Adicione créditos
No cartão. Você paga por token, sem assinatura.
$5.00recarga mínima - 3/3
Pergunte
No chat, ou instale o CLI e rode notholy login no terminal.
$ notholy login