![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <AutomationCommon.h>
Public Member Functions | |
| ENGINE_API | ~FScopedTestEnvironment () |
| ENGINE_API void | SetConsoleVariableValue (const FString &ConsoleVariableName, const FString &Value) |
| ENGINE_API bool | TryGetConsoleVariableValue (const FString &ConsoleVariableName, FString *OutValue) |
| ENGINE_API void | Restore () |
Static Public Member Functions | |
| static ENGINE_API TSharedPtr< FScopedTestEnvironment > | Get () |
Utility for setting and management of temporary CVars Will handle restoring the Console Variables (CVars) back to the original state on destruction.
| FScopedTestEnvironment::~FScopedTestEnvironment | ( | ) |
Restores all set Console Variables back to the original value
|
static |
Returns a shared pointer to current instance of the scoped test environment. Will create an instance if current instance is invalid.
| void FScopedTestEnvironment::Restore | ( | ) |
Restores all set Console Variables back to the original value
| void FScopedTestEnvironment::SetConsoleVariableValue | ( | const FString & | ConsoleVariableName, |
| 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.
| VariableName | Name of the Console Variable to set |
| Value | Value to be applied |
| bool FScopedTestEnvironment::TryGetConsoleVariableValue | ( | const FString & | ConsoleVariableName, |
| FString * | OutValue | ||
| ) |
Gets the current overridden value for the specified Console Variable
| VariableName | Name of the Console Variable to fetch the current value from |
| OutValue | Current value of the Console Variable if it was overridden. |