feat(test_framework): use TR_SAMPLE_BOTS env var for external bot directory

Adds TR_SAMPLE_BOTS env var support to point to external sample bots (Walls, Fire, SpinBot, etc). Updates test_bullet_economy.nim to use Walls from the sample-bots directory instead of custom WallsBot, removing the hardcoded path dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-16 08:43:46 +02:00
parent 67bba96da1
commit c671e0b0e3
2 changed files with 16 additions and 6 deletions
@@ -12,10 +12,10 @@ export battle_result.RoundResult
export battle_result.BotRoundResult
proc runBattle*(botDirs: seq[string], rounds: int = 10,
timeout: int = 120000): BattleResult =
timeout: int = 120000, maxSpeed: bool = true): BattleResult =
ensureServer()
discard compileBots(botDirs)
let stdout = runBattleRunner(getServerUrl(), botDirs, rounds, timeout)
let stdout = runBattleRunner(getServerUrl(), botDirs, rounds, timeout, maxSpeed)
result = parseServerOutput(stdout)
when isMainModule:
@@ -26,7 +26,8 @@ when isMainModule:
echo " let r = runBattle(@[\"path/to/BotA\", \"path/to/BotB\"])"
echo " echo r.winners"
echo ""
echo "Env vars forwarded to sub-modules:"
echo "Env vars:"
echo " TR_SERVER_JAR TR server JAR path"
echo " TR_BATTLE_RUNNER BattleRunner JAR path"
echo " TR_BATTLE_RUNNER_DIR BattleRunner class dir"
echo " TR_SAMPLE_BOTS Directory containing sample bots (e.g. Walls, Fire, SpinBot)"