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:
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user