gitgram/aitimemachine/git/t/unit-tests/generate-clar-suites.sh
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

64 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
if test $# -lt 2
then
echo "USAGE: $0 <CLAR_DECLS_H> <OUTPUT>" 2>&1
exit 1
fi
CLAR_DECLS_H="$1"
OUTPUT="$2"
awk '
function add_suite(suite, initialize, cleanup, count) {
if (!suite) return
suite_count++
callback_count += count
suites = suites " {\n"
suites = suites " \"" suite "\",\n"
suites = suites " " initialize ",\n"
suites = suites " " cleanup ",\n"
suites = suites " _clar_cb_" suite ", " count ", 1\n"
suites = suites " },\n"
}
BEGIN {
suites = "static struct clar_suite _clar_suites[] = {\n"
}
{
print
name = $3; sub(/\(.*$/, "", name)
suite = name; sub(/^test_/, "", suite); sub(/__.*$/, "", suite)
short_name = name; sub(/^.*__/, "", short_name)
cb = "{ \"" short_name "\", &" name " }"
if (suite != prev_suite) {
add_suite(prev_suite, initialize, cleanup, count)
if (callbacks) callbacks = callbacks "};\n"
callbacks = callbacks "static const struct clar_func _clar_cb_" suite "[] = {\n"
initialize = "{ NULL, NULL }"
cleanup = "{ NULL, NULL }"
count = 0
prev_suite = suite
}
if (short_name == "initialize") {
initialize = cb
} else if (short_name == "cleanup") {
cleanup = cb
} else {
callbacks = callbacks " " cb ",\n"
count++
}
}
END {
add_suite(suite, initialize, cleanup, count)
suites = suites "};"
if (callbacks) callbacks = callbacks "};"
print callbacks
print suites
print "static const size_t _clar_suite_count = " suite_count ";"
print "static const size_t _clar_callback_count = " callback_count ";"
}
' "$CLAR_DECLS_H" >"$OUTPUT"