c-game-regression-testinglisted
Install: claude install-skill SenjuWoo/Ultimate-AI-Starter-Bundle
# C Game Regression Testing
Games in this family are one big `.c` file with `static` everything, plus a folder of
`*_test.c` files that get compiled INTO the game source. The runner globs `*_test.c`,
so dropping a new test file in `source/` automatically adds it to the suite.
(Aeons Echo: Null Citadel line; same shape applies to future native C games.)
## Test file anatomy (copy this shape)
```c
#define WinMainCRTStartup WinMainDisabled /* silence WinMain from the included game */
#include "the_game.c" /* single TU: tests see every static */
#include <stdio.h>
#include "test_platform_stubs.inc" /* GL/window stubs */
static void reset_all(void){ memset(&g_save,0,sizeof(g_save));g_save.has_save=1;
init_player(1);clear_world();g_rng=<fixed seed>; } /* fixed seed = deterministic */
static int check(const char*name,int ok){printf("%s=%s\n",name,ok?"PASS":"FAIL");return ok;}
int main(void){ int ok=1; ok&=my_feature_works(); ... return ok?0:1; }
```
## Compile rules (get these wrong and nothing links)
- Compile the TEST FILE ALONE. Adding `game.c` alongside = dozens of multiple-definition
errors (`memset`, `_fltused`, `WinMainCRTStartup`, every win32 import).
- `-fno-builtin` is mandatory: the game defines its own `memset`/`memcpy`; without the
flag the compiler turns them into self-recursion.
- Link libs go AFTER the source file; add `-Wl,--stack,8388608` (big static arrays).
- Tests build with mingw gcc even when the release build i