UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FTestWorldWrapper Struct Reference

#include <AutomationCommon.h>

Public Member Functions

virtual ENGINE_API ~FTestWorldWrapper ()
 
UWorldGetTestWorld () const
 
virtual ENGINE_API bool CreateTestWorld (EWorldType::Type WorldType)
 
virtual ENGINE_API bool DestroyTestWorld (bool bForceGarbageCollect)
 
virtual ENGINE_API bool BeginPlayInTestWorld ()
 
virtual ENGINE_API bool TickTestWorld (float DeltaTime=0.01f)
 
virtual ENGINE_API bool EndPlayInTestWorld ()
 
virtual ENGINE_API void ReportFailure (const TCHAR *ErrorMessage)
 
virtual ENGINE_API void ClearFailureState ()
 
virtual ENGINE_API bool HasFailed () const
 
virtual ENGINE_API void AppendErrorMessages (TArray< FString > &OutErrorMessages) const
 
virtual ENGINE_API void ForwardErrorMessages (FAutomationTestBase *AutomationTest) const
 

Protected Attributes

UWorldTestWorld = nullptr
 
uint64 CachedFrameCounter = 0
 
TArray< FString > FailureErrors
 

Detailed Description

Utility class for creating and destroying a temporary test world, can be used for automation or performance testing. This can be used with any test framework but has utility functions for FAutomationTestBase.

Constructor & Destructor Documentation

◆ ~FTestWorldWrapper()

FTestWorldWrapper::~FTestWorldWrapper ( )
virtual

This will properly shut down and destroy the test world as needed

Member Function Documentation

◆ AppendErrorMessages()

void FTestWorldWrapper::AppendErrorMessages ( TArray< FString > &  OutErrorMessages) const
virtual

Gets the actual error messages for reporting to the automation framework

◆ BeginPlayInTestWorld()

bool FTestWorldWrapper::BeginPlayInTestWorld ( )
virtual

Starts play in the test world to simulate gameplay

◆ ClearFailureState()

void FTestWorldWrapper::ClearFailureState ( )
virtual

Clears any failures and initial state

◆ CreateTestWorld()

bool FTestWorldWrapper::CreateTestWorld ( EWorldType::Type  WorldType)
virtual

Creates a world of the appropriate world type, returns false on failure

◆ DestroyTestWorld()

bool FTestWorldWrapper::DestroyTestWorld ( bool  bForceGarbageCollect)
virtual

Destroys the test world and handles any required cleanup

◆ EndPlayInTestWorld()

bool FTestWorldWrapper::EndPlayInTestWorld ( )
virtual

Stops play properly

◆ ForwardErrorMessages()

void FTestWorldWrapper::ForwardErrorMessages ( FAutomationTestBase AutomationTest) const
virtual

Reports error messages to a passed in automation test

◆ GetTestWorld()

UWorld * FTestWorldWrapper::GetTestWorld ( ) const
inline

Gets the wrapped world, can be null

◆ HasFailed()

bool FTestWorldWrapper::HasFailed ( ) const
virtual

Returns true if there are any errors that should stop further execution

◆ ReportFailure()

void FTestWorldWrapper::ReportFailure ( const TCHAR ErrorMessage)
virtual

Registers an error message and marks test as failed, called by the functions above

◆ TickTestWorld()

bool FTestWorldWrapper::TickTestWorld ( float  DeltaTime = 0.01f)
virtual

Ticks the test world for one frame, defaults to 100 fps

Member Data Documentation

◆ CachedFrameCounter

uint64 FTestWorldWrapper::CachedFrameCounter = 0
protected

◆ FailureErrors

TArray<FString> FTestWorldWrapper::FailureErrors
protected

◆ TestWorld

UWorld* FTestWorldWrapper::TestWorld = nullptr
protected

The documentation for this struct was generated from the following files: