setting up robocode for acceptance testing

For much of this post, I obtained some really helpful information from the robocode wiki page:
debug a .NET robot in visual studio.

In my series of robocode posts I've been looking at how I can acceptance test my robot and I'd previously outlined a few steps that I needed to take to make this happen.

The first of these is to enable robocode to pick up the robot from a build folder and for my acceptance test I simply want it to point into the \bin\debug folder for my project.

Setting this up in robocode is very easy by going to Options > Preferences and adding a path into Development Options:


Now when I go to form a new battle in robocode I can pick up my robot and prove that it is available:


Now that I have the robot available I can now move onto how to debug through visual studio and this requires the command line options being put into the Debug properties of the C# project file:

The command line options I use for manual debugging (which I do very little of at all) are:
-cp libs/robocode.jar;libs/jni4net.j- 
-battle battles\debugging.battle
-results results\debugResults.txt

The most salient of which are:

-DRANDOMSEED:  This allows me to run the same predictive battle situation each time - instead of the robots beginning with random facing and start positions they will consistently begin the battle the same way.

-Ddebug: This prevents robocode from skipping a turn for the robot if it is waiting for a reply for too long (which would occur with breakpoints in visual studio)

-battle: Points to a custom battle file that I've set up for debugging

- results: The results file I want written to when the battle is over.

I can use the above setup for my acceptance testing (without debug and security flags) - if I can pass in the -battle and -results command line parameters when calling a .bat file from my test I can run custom robocode battles defined by the acceptance test itself.

Below is the resulting .bat file and I'm now ready to move onto creating the acceptance testing framework.


Last of all I want to wrap this post up by showing a battle file where you define, amongst other things, the number of rounds and the individual robots you want in the battle: