Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FAutomationTestFramework Class Reference

#include <AutomationTest.h>

+ Collaboration diagram for FAutomationTestFramework:

Classes

class  FAutomationTestMessageFilter
 
class  FAutomationTestOutputDevice
 

Public Member Functions

FString GetUserAutomationDirectory () const
 
bool RegisterAutomationTest (const FString &InTestNameToRegister, FAutomationTestBase *InTestToRegister)
 
bool UnregisterAutomationTest (const FString &InTestNameToUnregister)
 
void EnqueueLatentCommand (TSharedPtr< IAutomationLatentCommand > NewCommand)
 
void EnqueueNetworkCommand (TSharedPtr< IAutomationNetworkCommand > NewCommand)
 
bool ContainsTest (const FString &InTestName) const
 
bool RunSmokeTests ()
 
void ResetTests ()
 
void StartTestByName (const FString &InTestToRun, const int32 InRoleIndex)
 
bool StopTest (FAutomationTestExecutionInfo &OutExecutionInfo)
 
bool ExecuteLatentCommands ()
 
bool ExecuteNetworkCommands ()
 
void DequeueAllCommands ()
 
bool IsLatentCommandQueueEmpty () const
 
void LoadTestModules ()
 
void GetValidTestNames (TArray< FAutomationTestInfo > &TestInfo) const
 
bool ShouldTestContent (const FString &Path) const
 
void SetDeveloperDirectoryIncluded (const bool bInDeveloperDirectoryIncluded)
 
void SetRequestedTestFilter (const uint32 InRequestedTestFlags)
 
FOnTestScreenshotCapturedOnScreenshotCaptured ()
 
FOnTestScreenshotAndTraceCapturedOnScreenshotAndTraceCaptured ()
 
void SetForceSmokeTests (const bool bInForceSmokeTests)
 
bool GetCaptureStack () const
 
void SetCaptureStack (bool bCapture)
 
void AddAnalyticsItemToCurrentTest (const FString &AnalyticsItem)
 
FAutomationTestBaseGetCurrentTest () const
 
void NotifyScreenshotComparisonComplete (const FAutomationScreenshotCompareResults &CompareResults)
 
void NotifyTestDataRetrieved (bool bWasNew, const FString &JsonData)
 
void NotifyPerformanceDataRetrieved (bool bSuccess, const FString &ErrorMessage)
 
void NotifyScreenshotTakenAndCompared ()
 

Static Public Member Functions

static FAutomationTestFrameworkGet ()
 
static FAutomationTestFrameworkGetInstance ()
 

Public Attributes

FSimpleMulticastDelegate PreTestingEvent
 
FSimpleMulticastDelegate PostTestingEvent
 
FOnTestEvent OnTestStartEvent
 
FOnTestEvent OnTestEndEvent
 
FOnTestScreenshotComparisonComplete OnScreenshotCompared
 
FOnTestDataRetrieved OnTestDataRetrieved
 
FOnPerformanceDataRetrieved OnPerformanceDataRetrieved
 
FSimpleMulticastDelegate OnScreenshotTakenAndCompared
 

Private Member Functions

void PrepForAutomationTests ()
 
void ConcludeAutomationTests ()
 
void DumpAutomationTestExecutionInfo (const TMap< FString, FAutomationTestExecutionInfo > &InInfoToDump)
 
void InternalStartTest (const FString &InTestToRun)
 
bool InternalStopTest (FAutomationTestExecutionInfo &OutExecutionInfo)
 
 FAutomationTestFramework ()
 
 ~FAutomationTestFramework ()
 
 FAutomationTestFramework (const FAutomationTestFramework &)
 
FAutomationTestFrameworkoperator= (const FAutomationTestFramework &)
 

Private Attributes

FAutomationTestOutputDevice AutomationTestOutputDevice
 
FAutomationTestMessageFilter AutomationTestMessageFilter
 
FFeedbackContextOriginalGWarn = nullptr
 
TMap< FString, FAutomationTestBase * > AutomationTestClassNameToInstanceMap
 
TQueue< TSharedPtr< IAutomationLatentCommand > > LatentCommands
 
TQueue< TSharedPtr< IAutomationNetworkCommand > > NetworkCommands
 
uint32 RequestedTestFilter
 
double StartTime
 
bool bTestSuccessful
 
FAutomationTestBaseCurrentTest
 
FString Parameters
 
bool bDeveloperDirectoryIncluded
 
uint32 NetworkRoleIndex
 
FOnTestScreenshotCaptured TestScreenshotCapturedDelegate
 
FOnTestScreenshotAndTraceCaptured TestScreenshotAndTraceCapturedDelegate
 
bool bForceSmokeTests
 
bool bCaptureStack
 

Friends

class FAutomationTestOutputDevice
 

Detailed Description

Class representing the main framework for running automation tests

Definition at line 813 of file AutomationTest.h.

Constructor & Destructor Documentation

◆ FAutomationTestFramework() [1/2]

FAutomationTestFramework::FAutomationTestFramework ( )
private

Constructor

◆ ~FAutomationTestFramework()

FAutomationTestFramework::~FAutomationTestFramework ( )
private

Destructor

◆ FAutomationTestFramework() [2/2]

FAutomationTestFramework::FAutomationTestFramework ( const FAutomationTestFramework & )
private

Member Function Documentation

◆ AddAnalyticsItemToCurrentTest()

void FAutomationTestFramework::AddAnalyticsItemToCurrentTest ( const FString & AnalyticsItem)

Adds a analytics string to the current test to be parsed later. Must be called only when an automation test is in progress

Parameters
AnalyticsItemLog item to add to the current test

◆ ConcludeAutomationTests()

void FAutomationTestFramework::ConcludeAutomationTests ( )
private

Helper method called after automation testing is complete to restore settings to how they should be

◆ ContainsTest()

bool FAutomationTestFramework::ContainsTest ( const FString & InTestName) const

Checks if a provided test is contained within the framework.

Parameters
InTestNameName of the test to check
Returns
true if the provided test is within the framework; false otherwise

◆ DequeueAllCommands()

void FAutomationTestFramework::DequeueAllCommands ( )

Dequeue all latent and network commands

+ Here is the caller graph for this function:

◆ DumpAutomationTestExecutionInfo()

void FAutomationTestFramework::DumpAutomationTestExecutionInfo ( const TMap< FString, FAutomationTestExecutionInfo > & InInfoToDump)
private

Helper method to dump the contents of the provided test name to execution info map to the provided feedback context

Parameters
InContextContext to dump the execution info to
InInfoToDumpExecution info that should be dumped to the provided feedback context

◆ EnqueueLatentCommand()

void FAutomationTestFramework::EnqueueLatentCommand ( TSharedPtr< IAutomationLatentCommand > NewCommand)

Enqueues a latent command for execution on a subsequent frame

Parameters
NewCommand- The new command to enqueue for deferred execution

◆ EnqueueNetworkCommand()

void FAutomationTestFramework::EnqueueNetworkCommand ( TSharedPtr< IAutomationNetworkCommand > NewCommand)

Enqueues a network command for execution in accordance with this workers role

Parameters
NewCommand- The new command to enqueue for network execution

◆ ExecuteLatentCommands()

bool FAutomationTestFramework::ExecuteLatentCommands ( )

Execute all latent functions that complete during update

Returns
- true if the latent command queue is now empty and the test is complete

◆ ExecuteNetworkCommands()

bool FAutomationTestFramework::ExecuteNetworkCommands ( )

Execute the next network command if you match the role, otherwise just dequeue

Returns
- true if any network commands were in the queue to give subsequent latent commands a chance to execute next frame

◆ Get()

static FAutomationTestFramework & FAutomationTestFramework::Get ( )
static

Return the singleton instance of the framework.

Returns
The singleton instance of the framework.
+ Here is the caller graph for this function:

◆ GetCaptureStack()

bool FAutomationTestFramework::GetCaptureStack ( ) const
inline

Definition at line 1001 of file AutomationTest.h.

◆ GetCurrentTest()

FAutomationTestBase * FAutomationTestFramework::GetCurrentTest ( ) const
inline

Returns the actively executing test or null if there isn't one

Definition at line 1021 of file AutomationTest.h.

+ Here is the caller graph for this function:

◆ GetInstance()

static FAutomationTestFramework & FAutomationTestFramework::GetInstance ( )
inlinestatic

Definition at line 846 of file AutomationTest.h.

+ Here is the call graph for this function:

◆ GetUserAutomationDirectory()

FString FAutomationTestFramework::GetUserAutomationDirectory ( ) const

Gets a scratch space location outside of the project and saved directories. When an automation test needs to do something like generate project files, or create new projects it should use this directory, rather than pollute other areas of the machine.

◆ GetValidTestNames()

void FAutomationTestFramework::GetValidTestNames ( TArray< FAutomationTestInfo > & TestInfo) const

Populates the provided array with the names of all tests in the framework that are valid to run for the current application settings.

Parameters
TestInfoArray to populate with the test information

◆ InternalStartTest()

void FAutomationTestFramework::InternalStartTest ( const FString & InTestToRun)
private

Internal helper method designed to simply start the provided test name.

Parameters
InTestToRunName of the test that should be run
OutExecutionInfoResults of executing the test

◆ InternalStopTest()

bool FAutomationTestFramework::InternalStopTest ( FAutomationTestExecutionInfo & OutExecutionInfo)
private

Internal helper method designed to stop current executing test and return the results of execution.

Returns
true if the test was successfully run; false if it was not, could not be found, or is invalid for the current application settings

◆ IsLatentCommandQueueEmpty()

bool FAutomationTestFramework::IsLatentCommandQueueEmpty ( ) const
inline

Whether there is no latent command in queue

Definition at line 947 of file AutomationTest.h.

◆ LoadTestModules()

void FAutomationTestFramework::LoadTestModules ( )

Load any modules that are not loaded by default and have test classes in them

◆ NotifyPerformanceDataRetrieved()

void FAutomationTestFramework::NotifyPerformanceDataRetrieved ( bool bSuccess,
const FString & ErrorMessage )

◆ NotifyScreenshotComparisonComplete()

void FAutomationTestFramework::NotifyScreenshotComparisonComplete ( const FAutomationScreenshotCompareResults & CompareResults)

◆ NotifyScreenshotTakenAndCompared()

void FAutomationTestFramework::NotifyScreenshotTakenAndCompared ( )

◆ NotifyTestDataRetrieved()

void FAutomationTestFramework::NotifyTestDataRetrieved ( bool bWasNew,
const FString & JsonData )

◆ OnScreenshotAndTraceCaptured()

FOnTestScreenshotAndTraceCaptured & FAutomationTestFramework::OnScreenshotAndTraceCaptured ( )

Accessor for delegate called when a png screenshot is captured and a frame trace

◆ OnScreenshotCaptured()

FOnTestScreenshotCaptured & FAutomationTestFramework::OnScreenshotCaptured ( )

Accessor for delegate called when a png screenshot is captured

◆ operator=()

FAutomationTestFramework & FAutomationTestFramework::operator= ( const FAutomationTestFramework & )
private

◆ PrepForAutomationTests()

void FAutomationTestFramework::PrepForAutomationTests ( )
private

Helper method called to prepare settings for automation testing to follow

◆ RegisterAutomationTest()

bool FAutomationTestFramework::RegisterAutomationTest ( const FString & InTestNameToRegister,
FAutomationTestBase * InTestToRegister )

Register a automation test into the framework. The automation test may or may not be necessarily valid for the particular application configuration, but that will be determined when tests are attempted to be run.

Parameters
InTestNameToRegisterName of the test being registered
InTestToRegisterActual test to register
Returns
true if the test was successfully registered; false if a test was already registered under the same name as before
+ Here is the caller graph for this function:

◆ ResetTests()

void FAutomationTestFramework::ResetTests ( )

Reset status of worker (delete local files, etc)

◆ RunSmokeTests()

bool FAutomationTestFramework::RunSmokeTests ( )

Attempt to run all fast smoke tests that are valid for the current application configuration.

Returns
true if all smoke tests run were successful, false if any failed

◆ SetCaptureStack()

void FAutomationTestFramework::SetCaptureStack ( bool bCapture)
inline

Definition at line 1006 of file AutomationTest.h.

◆ SetDeveloperDirectoryIncluded()

void FAutomationTestFramework::SetDeveloperDirectoryIncluded ( const bool bInDeveloperDirectoryIncluded)

Sets whether we want to include content in developer directories in automation testing

◆ SetForceSmokeTests()

void FAutomationTestFramework::SetForceSmokeTests ( const bool bInForceSmokeTests)
inline

Sets forcing smoke tests.

Definition at line 996 of file AutomationTest.h.

◆ SetRequestedTestFilter()

void FAutomationTestFramework::SetRequestedTestFilter ( const uint32 InRequestedTestFlags)

Sets which set of tests to pull from.

◆ ShouldTestContent()

bool FAutomationTestFramework::ShouldTestContent ( const FString & Path) const

Whether the testing framework should allow content to be tested or not. Intended to block developer directories.

Parameters
Path- Full path to the content in question
Returns
- Whether this content should have tests performed on it

◆ StartTestByName()

void FAutomationTestFramework::StartTestByName ( const FString & InTestToRun,
const int32 InRoleIndex )

Attempt to start the specified test.

Parameters
InTestToRunName of the test that should be run
InRoleIndexIdentifier for which worker in this group that should execute a command

◆ StopTest()

bool FAutomationTestFramework::StopTest ( FAutomationTestExecutionInfo & OutExecutionInfo)

Stop the current test and return the results of execution

Returns
true if the test ran successfully, false if it did not (or the test could not be found/was invalid)

◆ UnregisterAutomationTest()

bool FAutomationTestFramework::UnregisterAutomationTest ( const FString & InTestNameToUnregister)

Unregister a automation test with the provided name from the framework.

Returns
true if the test was successfully unregistered; false if a test with that name was not found in the framework.

Friends And Related Symbol Documentation

◆ FAutomationTestOutputDevice

friend class FAutomationTestOutputDevice
friend

Definition at line 1150 of file AutomationTest.h.

Member Data Documentation

◆ AutomationTestClassNameToInstanceMap

TMap<FString, FAutomationTestBase*> FAutomationTestFramework::AutomationTestClassNameToInstanceMap
private

Mapping of automation test names to their respective object instances

Definition at line 1200 of file AutomationTest.h.

◆ AutomationTestMessageFilter

FAutomationTestMessageFilter FAutomationTestFramework::AutomationTestMessageFilter
private

Specialized feedback context used for message filtering during automated testing

Definition at line 1195 of file AutomationTest.h.

◆ AutomationTestOutputDevice

FAutomationTestOutputDevice FAutomationTestFramework::AutomationTestOutputDevice
private

Specialized output device used for automation testing

Definition at line 1192 of file AutomationTest.h.

◆ bCaptureStack

bool FAutomationTestFramework::bCaptureStack
private

Definition at line 1238 of file AutomationTest.h.

◆ bDeveloperDirectoryIncluded

bool FAutomationTestFramework::bDeveloperDirectoryIncluded
private

Whether we want to run automation tests on content within the Developer Directories

Definition at line 1224 of file AutomationTest.h.

◆ bForceSmokeTests

bool FAutomationTestFramework::bForceSmokeTests
private

Forces running smoke tests

Definition at line 1236 of file AutomationTest.h.

◆ bTestSuccessful

bool FAutomationTestFramework::bTestSuccessful
private

True if the execution of the test (but possibly not the latent actions) were successful

Definition at line 1215 of file AutomationTest.h.

◆ CurrentTest

FAutomationTestBase* FAutomationTestFramework::CurrentTest
private

Pointer to the current test being run

Definition at line 1218 of file AutomationTest.h.

◆ LatentCommands

TQueue< TSharedPtr<IAutomationLatentCommand> > FAutomationTestFramework::LatentCommands
private

Queue of deferred commands

Definition at line 1203 of file AutomationTest.h.

◆ NetworkCommands

TQueue< TSharedPtr<IAutomationNetworkCommand> > FAutomationTestFramework::NetworkCommands
private

Queue of deferred commands

Definition at line 1206 of file AutomationTest.h.

◆ NetworkRoleIndex

uint32 FAutomationTestFramework::NetworkRoleIndex
private

Participation role as given by the automation controller

Definition at line 1227 of file AutomationTest.h.

◆ OnPerformanceDataRetrieved

FOnPerformanceDataRetrieved FAutomationTestFramework::OnPerformanceDataRetrieved

Called when the performance data is retrieved.

Definition at line 835 of file AutomationTest.h.

◆ OnScreenshotCompared

FOnTestScreenshotComparisonComplete FAutomationTestFramework::OnScreenshotCompared

Called when a screenshot comparison completes.

Definition at line 829 of file AutomationTest.h.

◆ OnScreenshotTakenAndCompared

FSimpleMulticastDelegate FAutomationTestFramework::OnScreenshotTakenAndCompared

The final call related to screenshots, after they've been taken, and after they've been compared (or not if automation isn't running).

Definition at line 838 of file AutomationTest.h.

◆ OnTestDataRetrieved

FOnTestDataRetrieved FAutomationTestFramework::OnTestDataRetrieved

Called when the test data is retrieved.

Definition at line 832 of file AutomationTest.h.

◆ OnTestEndEvent

FOnTestEvent FAutomationTestFramework::OnTestEndEvent

Called when each automated test is ending

Definition at line 826 of file AutomationTest.h.

◆ OnTestStartEvent

FOnTestEvent FAutomationTestFramework::OnTestStartEvent

Called when each automated test is starting

Definition at line 823 of file AutomationTest.h.

◆ OriginalGWarn

FFeedbackContext* FAutomationTestFramework::OriginalGWarn = nullptr
private

Definition at line 1197 of file AutomationTest.h.

◆ Parameters

FString FAutomationTestFramework::Parameters
private

Copy of the parameters for the active test

Definition at line 1221 of file AutomationTest.h.

◆ PostTestingEvent

FSimpleMulticastDelegate FAutomationTestFramework::PostTestingEvent

Called after all automated tests have completed

Definition at line 820 of file AutomationTest.h.

◆ PreTestingEvent

FSimpleMulticastDelegate FAutomationTestFramework::PreTestingEvent

Called right before automated test is about to begin

Definition at line 817 of file AutomationTest.h.

◆ RequestedTestFilter

uint32 FAutomationTestFramework::RequestedTestFilter
private

Whether we are currently executing smoke tests for startup/commandlet to minimize log spam

Definition at line 1209 of file AutomationTest.h.

◆ StartTime

double FAutomationTestFramework::StartTime
private

Time when the test began executing

Definition at line 1212 of file AutomationTest.h.

◆ TestScreenshotAndTraceCapturedDelegate

FOnTestScreenshotAndTraceCaptured FAutomationTestFramework::TestScreenshotAndTraceCapturedDelegate
private

Delegate called at the end of the frame when a screenshot and frame trace is captured and a .png is requested

Definition at line 1233 of file AutomationTest.h.

◆ TestScreenshotCapturedDelegate

FOnTestScreenshotCaptured FAutomationTestFramework::TestScreenshotCapturedDelegate
private

Delegate called at the end of the frame when a screenshot is captured and a .png is requested

Definition at line 1230 of file AutomationTest.h.


The documentation for this class was generated from the following file: