Skip to content
Back to skills

Unreal Automation Tests

ASecurity

Unreal automation tests: IMPLEMENT_SIMPLE_AUTOMATION_TEST, Automation Spec, latent commands, Automation RunTest on the command line, the JSON report as verdict.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythongoc++bash

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add tipoLi5890/game-studio --skill unreal-automation-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Unreal Automation Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Unreal Automation Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tipoli5890-unreal-automation-tests/badge)](https://www.skillsdirectory.com/skills/tipoli5890-unreal-automation-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: unreal-automation-tests
description: >-
  Unreal automation tests: IMPLEMENT_SIMPLE_AUTOMATION_TEST, Automation Spec, latent commands,
  Automation RunTest on the command line, the JSON report as verdict.
---

# unreal-automation-tests — tests the engine runs, and a report a script reads

The engine's automation framework runs C++ tests inside the editor; run headless with a report
folder, it leaves a JSON report and a few fixed log lines, and those two decide the verdict. The
process exit code does not: a filter that matched nothing and a crash before the first test both
end quietly.

## Load what the situation needs

| The situation | Read |
|---|---|
| "Add a test for this rule", a first test in the project | *The method* below, `templates/RouteMathTest.cpp` |
| Simple, complex or spec; flags; assertions; latent commands | `reference/writing-tests.md` |
| Many cases from data (one per map, one per parcel kind) | `reference/writing-tests.md` §3 |
| Describe / It / BeforeEach, a case that waits for something | `reference/writing-tests.md` §4–5, `templates/RouteMath.spec.cpp` |
| Run tests headless; filters; groups; exclusions; resume after a crash | `reference/running-tests.md` |
| Did the run pass? A report folder or a log to judge | `reference/reading-results.md`, `scripts/test_report.py` |
| Zero tests ran, a test never completed, report and log disagree | `reference/reading-results.md` §5, `reference/writing-tests.md` §6 |
| Building the editor target before a run | `unreal-compile-loop` |
| Starting the editor headless under a timeout | `unreal-editor-python` |

## The method

1. **Put the rule in plain C++.** `templates/RouteMath.h` and `RouteMath.cpp`: a struct of static
   functions on plain data (`FRouteMath::RouteLength`). A rule that lives only in an actor's tick
   needs a map and frames to test; move it out first.
2. **Write the test** in the module's `Private/Tests/`: `templates/RouteMathTest.cpp` (one
   `IMPLEMENT_SIMPLE_AUTOMATION_TEST` whose `RunTest` returns every check's result) or
   `templates/RouteMath.spec.cpp` (`BEGIN_DEFINE_SPEC`, `Describe`, `It`). Name it by dot path,
   `CourierRun.RouteMath.Length`, and give it `EAutomationTestFlags::EditorContext` so a headless
   editor can run it.
3. **Build the editor target** (`unreal-compile-loop`). A test added after the last build does not
   exist in the run.
4. **Run it headless** with a fresh report folder, through the runner in `unreal-editor-python`:

   ```bash
   UnrealEditor-Cmd.exe "C:/Work/CourierRun/CourierRun.uproject" \
     -ExecCmds="Automation RunTest CourierRun.RouteMath;Quit" \
     -ReportExportPath="C:/Work/CourierRun/Saved/TestReports/route" \
     -unattended -nullrhi -nosplash -stdout -FullStdOutLogOutput
   ```

5. **Judge it** from the report and the log:

   ```bash
   python3 scripts/test_report.py --report "C:/Work/CourierRun/Saved/TestReports/route" \
       --log run.log --require CourierRun.RouteMath.Length
   ```

   ```
   test_report: PASS 4 passed, 0 failed, 0 skipped; report .../route/<report>.json, log run.log
   ```

## The verdict

| Exit | Verdict | When |
|---|---|---|
| 0 | `PASS` | tests ran (at least `--min-tests`), every one `Success`, the log reached `**** TEST COMPLETE. EXIT CODE: 0 ****`, every `--require` test passed |
| 2 | `FAIL` | a failed test; zero tests ran; a test that started and never completed; `inProcess` or `notRun` in the report; no closing `EXIT CODE` line, or a non-zero one; a `Fatal` line; report and log disagreeing |
| 3 | `UNVERIFIED` | nothing readable: no report under the folder and no usable log, or a log without one automation line |
| 1 | usage | neither `--report` nor `--log`, a bad flag |

A `Skipped` test (an exclusion in config) is listed and not counted as run.

## Traps

- **Zero tests is a failure.** A misspelt filter, a module missing from the target that ran, or a
  test without `EditorContext` all give a clean, empty run.
- **Return the checks.** Every `Test*` call logs its own error and returns whether it held; have
  `RunTest` return their conjunction, so the verdict never rests on one line.
- **Queued latent commands run after `RunTest` returns.** A check written below
  `ADD_LATENT_AUTOMATION_COMMAND` runs before the map loads; put it inside a command's `Update()`
  or a `LatentIt`.
- **A latent case must end.** A `LatentIt` that never calls `Done.Execute()` holds the run until
  the outside timeout; the report then shows a test in progress.
- **One report folder per run.** The parser reads the newest report under the folder; a stale one
  from an earlier run can stand in for a run that wrote nothing.
- **`-nullrhi` has no rendering device.** A test flagged `NonNullRHI` needs one: run it without
  `-nullrhi`.
- **The dot path is the contract with CI.** Rename a test and its `--require` line together, or
  the renamed test fails CI as absent.

## Related skills

- `unreal-compile-loop` → `reference/build-commands.md`: building the editor target the tests run in
- `unreal-editor-python` → `reference/headless-runs.md`: the headless run, its timeout and its sentinel
- `unreal-config-logs` → `reference/logging.md`: the log and its categories; the crash folder
- `unreal-project` → `reference/engine-discovery.md`: finding the binary and the project's modules first

Files in this skill

  • SKILL.md5.2 KB
  • reference/reading-results.md5.1 KB
  • reference/running-tests.md4.4 KB
  • reference/writing-tests.md7.6 KB
  • scripts/test_report.py20.6 KB
  • templates/RouteMath.cpp317 B
  • templates/RouteMath.h456 B
  • templates/RouteMath.spec.cpp1.1 KB
  • templates/RouteMathTest.cpp1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.