Framework for testing for ArmA2 series games

A2 Testbench can help you scripting what is needed outside the game engine.
The script language is AutoHotkey, and A2 Testbench provides a library of functions to ease the automation.
The main concept around the Testbench is having ArmA2 executables runing and doing their job with their profiles pointing to a temporary common directory for each testing.

Third party tools

Mikero's PboDLL tools like
  • ExtractPbo.exe
  • MakePbo.exe
  • Rapify.exe

may be needed in tests included in this distribution. Please download them into the testbench root folder, together with DePbo.dll.
The computer may also need to be unplugged from the Internet when using -host, or using a custom socket library (ws2_32.dll)provided at dev-heaven.net. It's a workaround for issue #3445.

How it works

  • You write test cases directories under tests folder
    • Every test is a separated directory
    • In one of those directories, just double click init.ahk to start
  • Common resources for tests put in a shared directory under lib
    • Available in variable TestbenchDir in the init.ahk script
    • Using searchmission() the script can search in default ArmA2 directories, or custom -profiles or -name
  • Test case will run, read and write files in a time-stamped directory under run
    • The run directories will have the format YYYYMMDD_hhmmss (year, month, day of month, hours, minutes, and seconds)
  • Unmanned mouse clicking and keystrokes inside ArmA2 windows are possible with Autohotkey's SendMode Input
  • It's possible to automate the menu navigation reading color of pixels or scan for images

Directory tree

  • %TestbenchDir%
    • lib/ (was etc/)
      • source for common missions, configuration files, profiles
    • tests/
      • myTest/
        • %A_ScriptDir%
        • a test case. Contains init.cmd, init.ahk and other files for the test to run
    • run/
      • YYYYMMDD_hhmmss/
        • %A_WorkingDir%
        • a single test run
          • profile/ like MPH, MPC, DS
            • arma2[oa].cfg, <user>.Profile, arma2[oa].RPT, crash dumps, missions

Step by step guides