ue-testing-debugging

Use when writing automation tests, functional tests, or any test in Unreal Engine. Also use when the user asks about "UE_LOG", logging, log categories, assertion, check, ensure, verify, DrawDebug, debug draw, console command, profiling, Unreal Insights, stat commands, or debugging techniques. See ue

By quodsoler · 860 installs

npx skills add quodsoler/unreal-engine-skills --skill ue-testing-debugging

Source repository · Upstream listing

UE Testing & Debugging You are an expert in testing, debugging, and profiling Unreal Engine C++ projects. Context Read .agents/ue project context.md for engine version, existing log categories, test infrastructure (automation modules, test maps), and project specific conventions before providing guidance. Before You Start Ask which area the user needs help with if unclear: Automation tests — unit/integration tests using IMPLEMENT SIMPLE AUTOMATION TEST Functional tests — actor based AFunctionalTest in maps Logging — UE LOG, custom categories, verbosity filtering Assertions — check, ensure, verify and when to use each Debug drawing — DrawDebug helpers for runtime visualization Console commands — UFUNCTION(Exec), FAutoConsoleCommand, CVars Profiling — Unreal Insights, stat commands, SCOPE CYCLE COUNTER Automation Framework Automation tests live in a dedicated module (e.g., MyGameTests ) that depends on "AutomationController" . Include the module in the editor target via ExtraModuleNames and conditionally in the game target via if (bWithAutomationTests) . Simple Tests Complex / Parameterized Tests IMPLEMENT COMPLEX AUTOMATION TEST requires overriding GetTests() to populate the parameter list, and RunTest(Parameters) receives each entry in turn. Test Assertion Methods Test Flags Reference Flag Meaning EditorContext Runs in the editor process ClientContext Runs in game client ServerContext Runs on dedicated server SmokeFilter Fast; runs on every CI check in ProductFilter Project/game level tests Latent Commands (Async Testing) Use latent commands when the test must wait for an async operation. Update() returns true when done, false to retry next frame. See references/automation test patterns.md for delegate wait, timeout, and post async assertion patterns. Functional Tests AFunctionalTest is a UCLASS actor placed in a test map. Override StartTest() and call FinishTest() when done. Place actors in Maps/Test MyFeature.umap . Run via RunAutomationTest "MyGame.Functional.MyFeature" or the Session Frontend. TimeLimit Logging Declaring and Defining a Category UE LOG Usage Verbosity Levels (highest to lowest severity) Level When to use Fatal Crash worthy unrecoverable errors Error Operation failed, needs developer attention Warning Unexpected but recoverable condition Display User visible output (always shown) Log Standard development info Verbose Detailed per frame or per call info VeryVerbose Trace level; very high frequency Structured Logging (UE 5.2+) Runtime Log Filtering Assertions Assertions are defined in Misc/AssertionMacros.h . Understand the build configuration behaviour before choosing one. check / checkf ensure / ensureMsgf verify / verifyf Decision Guide Situation Macro Class invariant, programmer error check / checkf Recoverable condition, want to continue ensure / ensureMsgf Expression has side effects always needed verify / verifyf Debug build heavy validation checkSlow User facing input validation none — use explicit if/return Debug Drawing Debug draw functions from DrawDebugHelpers.h render geometry directly in the world viewport during PIE or standalone builds. They are stripped by if ENABLE DRAW DEBUG in Shipping. Console Commands Exec Functions Exec functions work when typed in the console (~) if on a PlayerController , Pawn , HUD , GameMode , GameState , CheatManager , or GameInstance . FAutoConsoleCommand and CVars Runtime Command Registration Unlike FAutoConsoleCommand (static init registration), RegisterConsoleCommand registers at runtime and returns a handle for explicit cleanup. Custom Stat Groups & Profiling Markers Debugging Techniques Visual Logger Gameplay Debugger Press ' (apostrophe) in PIE to open the Gameplay Debugger. It shows AI, EQS, Ability System, and custom categories. Register a custom category in module startup: IDE Breakpoint Debugging Attach Visual Studio or Rider to the running UnrealEditor process (Debug Attach to Process). Use DebugGame or Debug configuration for full symbol resolution Development strips many symbols. For check() and ensure() failures, set breakpoints on the handler functions above they fire before crash/log, letting you inspect the call stack. Crash Analysis Minidumps land in Saved/Crashes/ . Open with UnrealEditor Win64 DebugGame PDB in WinDbg or Rider. FDebug::DumpStackTraceToLog(ELogVerbosity::Error) prints the current callstack to the log. ensure submits a callstack to the Crash Reporter without crashing the process. Network : NetTrace for replication capture, stat net for live bandwidth, net.ListActorChannels for actor channels. Key profiling commands : stat startfile / stat stopfile (.uestats capture for Insights), stat gpu / ProfileGPU (GPU timing), stat memoryplatform / memreport full (memory), trace=cpu,gpu,frame,memory (Insights launch args). See references/profiling commands.md . Common Mistakes check() in shipping — check() expressions are compiled out of Shipping builds. Never put required logic inside a check expression; use verify() if the expression must always evaluate. ensure fires only once — After the first ensure failure at a call site, subsequent calls at that site are silent. Use ensureAlways if you need every failure reported. DrawDebug in shipping — DrawDebug calls do not exist in Shipping without ENABLE DRAW DEBUG . Wrap persistent draws with if ENABLE DRAW DEBUG . Missing log category — Defining UE LOG with a category not visible in the current translation unit causes a linker error. Include the header that declares the category. Automation test without a filter flag — Every IMPLEMENT SIMPLE AUTOMATION TEST must have exactly one filter flag (Smoke, Engine, Product, Perf, Stress, or Negative). Missing it is a compile time static assert failure. Latent command after return true — Latent commands are enqueued before the function returns. Do not enqueue them after the return true; statement. Log spam in multiplayer — Identical log calls fire from both server and each client. Prefix messages with GetWorld() GetNetMode() or use UE CLOG(HasAuthority(), ...) to reduce noise. Related Skills ue cpp foundations — UE macro system, delegates, FString, UE LOG basics ue module build system — setting up a dedicated test module and target inclusion ue actor component architecture — AFunctionalTest placement and world interaction References references/automation test patterns.md — test setup patterns, latent commands, common scenarios references/profiling commands.md — stat commands, Insights capture, analysis workflow