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

#include <AutomationCommon.h>

Public Member Functions

ENGINE_API FTestConsoleVariable (const FString &InConsoleVariableName)
 
ENGINE_API FTestConsoleVariable (FTestConsoleVariable &&Other)
 
ENGINE_API ~FTestConsoleVariable ()
 
ENGINE_API void Set (const FString &Value)
 
ENGINE_API FString Get ()
 
ENGINE_API void Restore ()
 

Detailed Description

Utility for setting and restoring of a Console Variable (CVar).

Note that race conditions are possible when multiple FTestConsoleVariable objects refer to the same Console Variable and get restored/destroyed in an order different than they were set. Please use FScopedTestEnvironment to manage multiple FTestConsoleVariable objects.

Constructor & Destructor Documentation

◆ FTestConsoleVariable() [1/2]

FTestConsoleVariable::FTestConsoleVariable ( const FString &  InConsoleVariableName)

◆ FTestConsoleVariable() [2/2]

FTestConsoleVariable::FTestConsoleVariable ( FTestConsoleVariable &&  Other)

◆ ~FTestConsoleVariable()

FTestConsoleVariable::~FTestConsoleVariable ( )

Member Function Documentation

◆ Get()

FString FTestConsoleVariable::Get ( )

Returns the current value of the Console Variable

◆ Restore()

void FTestConsoleVariable::Restore ( )

Returns the Console Variable to the original value

◆ Set()

void FTestConsoleVariable::Set ( const FString &  Value)

Sets a Console Variable to the specified value. Will keep a reference to the original value regardless of how many times the value has been set.

Parameters
ValueValue to set on the Console Variable

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