• src/doors/clans-src/docs/gtest.txt src/doors/clans-src/src/gtest.c scr

    From Deuc¿@VERT to Git commit to main/sbbs/master on Sat Mar 14 23:32:39 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/a97a0162f84880adb4aa39c0
    Added Files:
    src/doors/clans-src/docs/gtest.txt src/doors/clans-src/src/gtest.c scripteng.c scripteng.h src/doors/clans-src/tests/fixtures/gtest/autofight.script src/doors/clans-src/tests/test_gtest.sh
    Modified Files:
    src/doors/clans-src/GNUmakefile src/doors/clans-src/mk/Paths.gmake src/doors/clans-src/src/GNUmakefile console.c console.h qtest.c src/doors/clans-src/tests/GNUmakefile
    Log Message:
    Add gtest: script-driven combat integration test tool

    Extract shared script engine from qtest.c into scripteng.c/scripteng.h
    so both tools reuse the same Type=value script format, hook callbacks,
    and error handling. Add hook_get_key (Key= type) for raw keystroke
    scripting. Add Console_SetGetKeyHook to console.c.

    Create gtest.c -- a standalone binary that links the real combat engine (fight.c, spells.c, items.c, class.c) against mock stubs for the rest
    of the game (user.c, news.c, mail.c, ibbs.c, etc.). Supports two
    commands:

    -c autofight AI-controlled combat against a test goblin
    -c levelup Level-up check with preset XP values

    Random control: -r VALUE (fixed mod, fully deterministic), -R SEED
    (seeded PRNG), or neither (unseeded rand). State summary printed to
    stderr for test assertions.

    Add TEST_BINARIES list in mk/Paths.gmake for developer-only test tools
    (not shipped with game or devkit).

    Add 21 integration tests in tests/test_gtest.sh covering argument
    validation, autofight at multiple levels, deterministic reproducibility
    with -r, gold arguments, and level-up verification.

    Add docs/gtest.txt with usage, script format, and architecture docs.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net