test_cli: an own cooldown dir, so a real quota file cannot bench the transport

A cooldown file for "cli" in ~/.splinter/cooldown (left behind by a real
Claude call) made the first 20 checks fail on main, unrelated to any
change: the transport was skipped before it ran. The test now points
SPLINTER_COOLDOWN_DIR at a fresh mkdtemp for the whole run.

Proof: before, tests/test_cli reported 31 failures on a clean main with
that file present; after, 'tests/test_cli: ok' and 'make check' passes.
This commit is contained in:
lotherk committed 2026-11-22 20:09:41 +00:00
1 parent bc0b9f22f9
commit f568f558d0
1 file changed
+8
+8
View File
@@ -136,6 +136,14 @@ main(void)
return 1;
setenv("SPLINTER_CLI_CMD", "sed 's/^/X: /'", 1);
/*
* A real cooldown file for "cli" in ~/.splinter/cooldown would bench this
* transport before it ever runs, and the test would report a broken
* transport. Every host here gets its own empty cooldown directory.
*/
snprintf(tdir, sizeof(tdir), "/tmp/splinter-cli-cool-XXXXXX");
if (mkdtemp(tdir) != NULL)
setenv("SPLINTER_COOLDOWN_DIR", tdir, 1);
host = sp_host_new(&reg, &ag, NULL);
CHECK(host != NULL);
CHECK(sp_plugin_load(host, "plugins/cli/cli.so", &err) == 0);