import std/[os, strutils] import test_framework/test_framework import test_framework/battle_result import test_framework/server_manager import test_framework/bot_compiler import test_framework/runner_process const modularBotDir = currentSourcePath().parentDir.parentDir tfAdversaries = currentSourcePath().parentDir.parentDir.parentDir / "common_libs" / "test_framework" / "adversaries" sittingDuck = tfAdversaries / "SittingDuck" # Skip if JARs are missing if not fileExists("/home/davide/Projects/tank-royale/server/build/libs/robocode-tankroyale-server-0.35.5-all.jar") or not fileExists("/home/davide/Projects/tank-royale/runner/examples/lib/robocode-tankroyale-runner.jar"): echo "Skipping: Tank Royale JARs not found" quit(0) # Compile bots let compiledBots = compileBots(@[modularBotDir, sittingDuck]) echo "Compiled bots: ", compiledBots # Run battle ensureServer() let stdout = runBattleRunner(getServerUrl(), @[modularBotDir, sittingDuck], 3, 300000, true) echo "" echo "Raw battle runner output (last 50 lines):" let lines = stdout.split('\n') let start = max(0, lines.len - 50) for i in start..