Skip to content

Unreal Engine: testing

Automated tests for Unreal Engine projects, from C++ unit tests to tests of packaged builds on the target platforms.

Entries are sorted by score from 1 to 10 (criteria): 9–10 start here or strongly recommended, 6–8 recommended, 1–5 further reading or conditional.

Adopted references

Key rules

  • 7 UNREAL-14 Write automated tests with the Automation Test Framework, use Low-Level Tests for pure unit tests, and run both from the command line in CI. (Automation Test Framework, Run Automation Tests, Write Low-Level Tests)
  • 6 UNREAL-42 Follow Epic's test design guidelines: don't assume the state of the game or the editor, because tests can run in any order or in parallel on several machines, leave files on disk as you found them, and mark a test as a Smoke test only if it finishes within a second. Reset state before and after each test with a Spec's BeforeEach and AfterEach, a CQTest TEST_CLASS, or a Functional Test's PrepareTest and OnTestFinished. (Unreal Engine, Automation Test Framework: test design guidelines, Automation Spec, CQTest, Functional Testing)
  • 6 UNREAL-43 Run boot tests and automation tests on packaged builds for each target platform with Gauntlet, not only in the editor. Gauntlet is designed to run Unreal sessions on many platforms, including multiplayer sessions with several clients and a server. UE.BootTest checks that a build starts, and UE.TargetAutomation runs Automation Test Framework tests in a packaged game. To deploy to consoles and mobile devices, Gauntlet needs that platform's device interfaces implemented. (Unreal Engine, Gauntlet Automation Framework, Running Gauntlet Tests)
  • 5 UNREAL-41 Write tests for code that needs engine systems as Automation Spec or CQTest tests rather than with the plain automation test macros, and test gameplay that spans frames or needs a level with Functional Tests, Actors placed in a test level. Specs and CQTest are easier to read and make latent and asynchronous steps simpler to write. Put C++ tests in the Private/Tests folder of the module they test, and tests that bring their own maps or content in a test plugin, which you can leave out of packaged builds. (Unreal Engine, Automation Test Framework, Automation Spec, CQTest, Functional Testing, Write C++ Tests)
  • 4 UNREAL-44 Catch rendering regressions with screenshot comparison tests: place Functional Screenshot Test Actors in test levels, turn off noisy rendering features, set a tolerance, and review differences in the Screenshot Comparison browser. (Unreal Engine, Screenshot Comparison Tool)

How to enforce

Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.

  • 6 Gauntlet RunUnreal: the UE.EditorAutomation and UE.TargetAutomation tests run Automation Test Framework tests in the editor or in a packaged build from a build system, and can resume after a crash. For a simpler setup, pass -ExecCmds="Automation RunTest …" to the editor. Checks UNREAL-14 and UNREAL-43.