From d3c9e41c8a68080ce32a4cf4e2e3b488a6095a5a Mon Sep 17 00:00:00 2001 From: Andrew Hundt Date: Wed, 1 Jul 2026 20:16:33 -0400 Subject: [PATCH] docs(tests): clarify full-suite entrypoints Remove a stale exact test count from the contributor guide and document the existing full-suite, focused-suite, sanitizer, architecture, static-link, and hang-guard entrypoints. This keeps the test workflow understandable without adding new flags. Signed-off-by: Andrew Hundt --- CONTRIBUTING.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4f32b4f9..57b9bcfc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,12 +26,23 @@ The binary is output to `build/c/codebase-memory-mcp`. scripts/test.sh ``` -This builds with ASan + UBSan and runs all tests (~2040 cases). Key test files: +This is the local maintainer gate used by the project scripts. It cleans the C build, runs the +full ASan + UBSan C test suite, builds the production binary, and then runs the parent-watchdog +and security-string regression scripts. The exact test count changes as suites are added; use the +runner summary as the source of truth. Key test files: - `tests/test_pipeline.c` — pipeline integration tests - `tests/test_httplink.c` — HTTP route extraction and linking - `tests/test_mcp.c` — MCP protocol and tool handler tests - `tests/test_store_*.c` — SQLite graph store tests +Useful script options and environment: + +```bash +scripts/test.sh --arch arm64 # macOS: force target architecture +scripts/test.sh CC=clang CXX=clang++ # override compiler +CBM_RUN_HANG_TEST=1 scripts/test.sh # include the slower C++ index-hang guard +``` + ## Run C Server Tests The MCP server core is written in C and has its own test suite under `tests/`: @@ -55,6 +66,14 @@ CBM_ONLY_SUITE=pipeline CBM_ONLY_TEST=exact build/c/test-runner By default, tests isolate `CBM_CACHE_DIR` in a temporary directory so local indexes are not polluted. Set `CBM_TEST_NO_ISOLATE=1` only when intentionally testing the user's configured cache. +Build flags follow the Makefile conventions: + +```bash +make -f Makefile.cbm test SANITIZE= # disable ASan/UBSan, mainly for unsupported toolchains +make -f Makefile.cbm cbm CFLAGS_EXTRA=-DCBM_VERSION=dev +make -f Makefile.cbm cbm STATIC=1 # static link where supported +``` + **Memory leak detection:** On **macOS**, `test-leak` builds a sanitizer-free binary (`test-runner-nosan`) and runs Apple's