engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | Protected 属性 | 友元 | 所有成员列表
FAutomationTestBase类 参考abstract

Simple abstract base class for all automation tests 更多...

#include <AutomationTest.h>

被 FAutomationSpecBase , 以及 FBDDAutomationTestBase 继承.

Public 成员函数

virtual void AddAnalyticsItem (const FString &InAnalyticsItem)
 Adds a analytics string to parse later 更多...
 
FORCEINLINE void AddCommand (IAutomationLatentCommand *NewCommand)
 Enqueues a new latent command.
 
FORCEINLINE void AddCommand (IAutomationNetworkCommand *NewCommand)
 Enqueues a new latent network command.
 
virtual void AddError (const FString &InError, int32 StackOffset=0)
 Adds an error message to this test 更多...
 
virtual void AddErrorIfFalse (bool bCondition, const FString &InError, int32 StackOffset=0)
 Adds an error message to this test if the condition is false 更多...
 
virtual void AddErrorS (const FString &InError, const FString &InFilename, int32 InLineNumber)
 Adds an error message to this test 更多...
 
virtual void AddEvent (const FAutomationEvent &InEvent, int32 StackOffset=0)
 Adds an automation event directly into the execution log. 更多...
 
void AddExpectedError (FString ExpectedPatternString, EAutomationExpectedErrorFlags::MatchType CompareType=EAutomationExpectedErrorFlags::Contains, int32 Occurrences=1)
 Adds a regex pattern to an internal list that this test will expect to encounter in error or warning logs during its execution. 更多...
 
virtual void AddInfo (const FString &InLogItem, int32 StackOffset=0)
 Adds a log item to this test 更多...
 
virtual void AddWarning (const FString &InWarning, int32 StackOffset=0)
 Adds a warning to this test 更多...
 
virtual void AddWarningS (const FString &InWarning, const FString &InFilename, int32 InLineNumber)
 Adds an warning message to this test 更多...
 
void ClearExecutionInfo ()
 Clear any execution info/results from a prior running of this test
 
virtual bool ElevateLogWarningsToErrors ()
 If returns true then logging with a level of Warning will be treated as an error 更多...
 
 FAutomationTestBase (const FString &InName, const bool bInComplexTask)
 Constructor 更多...
 
void GenerateTestNames (TArray< FAutomationTestInfo > &TestInfo) const
 Helper function that will generate a list of sub-tests via GetTests
 
void GetExecutionInfo (FAutomationTestExecutionInfo &OutInfo) const
 Populate the provided execution info object with the execution info contained within the test. 更多...
 
void GetExpectedErrors (TArray< FAutomationExpectedError > &OutInfo) const
 Populate the provided expected errors object with the expected errors contained within the test. 更多...
 
virtual uint32 GetRequiredDeviceNum () const =0
 Pure virtual method; returns the number of participants for this test 更多...
 
virtual FString GetTestAssetPath (const FString &Parameter) const
 Allows navigation to the asset associated with the test if there is one.
 
FString GetTestContext () const
 Gets the parameter context of the test.
 
virtual uint32 GetTestFlags () const =0
 Pure virtual method; returns the flags associated with the given automation test 更多...
 
FString GetTestName () const
 Gets the C++ name of the test.
 
virtual FString GetTestOpenCommand (const FString &Parameter) const
 Return an exec command to open the test associated with this parameter.
 
virtual int32 GetTestSourceFileLine () const
 Gets the line number where this test was defined.
 
virtual int32 GetTestSourceFileLine (const FString &InTestName) const
 Gets the line number where this test was defined.
 
virtual FString GetTestSourceFileName () const
 Gets the filename where this test was defined.
 
virtual FString GetTestSourceFileName (const FString &InTestName) const
 Gets the filename where this test was defined.
 
bool HasAnyErrors () const
 Returns whether this test has any errors associated with it or not 更多...
 
bool HasMetExpectedErrors ()
 Returns whether this test has encountered all expected errors defined for it 更多...
 
const bool IsComplexTask () const
 Is this a complex tast - if so it will be a stress test. 更多...
 
void SetSuccessState (bool bSuccessful)
 Forcibly sets whether the test has succeeded or not 更多...
 
virtual bool SuppressLogErrors ()
 If returns true then logging with a level of Error will not be recorded in test results 更多...
 
virtual bool SuppressLogs ()
 If true no logging will be included in test events 更多...
 
virtual bool SuppressLogWarnings ()
 If returns true then logging with a level of Warning will not be recorded in test results 更多...
 
template<typename ValueType >
bool TestEqual (const TCHAR *What, const ValueType &Actual, const ValueType &Expected)
 Logs an error if the two values are not equal. 更多...
 
bool TestFalse (const TCHAR *What, bool Value)
 Logs an error if the specified Boolean value is not false. 更多...
 
template<typename ValueType >
bool TestInvalid (const TCHAR *Description, const TSharedPtr< ValueType > &SharedPointer)
 Logs an error if the given shared pointer is valid. 更多...
 
template<typename ValueType >
bool TestNotEqual (const TCHAR *Description, const ValueType &Actual, const ValueType &Expected)
 Logs an error if the two values are equal. 更多...
 
template<typename ValueType >
bool TestNotNull (const TCHAR *What, ValueType *Pointer)
 Logs an error if the specified pointer is NULL. 更多...
 
template<typename ValueType >
bool TestNotSame (const TCHAR *Description, const ValueType &Actual, const ValueType &Expected)
 Logs an error if the two values are the same object in memory. 更多...
 
bool TestNull (const TCHAR *What, const void *Pointer)
 Logs an error if the specified pointer is not NULL. 更多...
 
template<typename ValueType >
bool TestSame (const TCHAR *Description, const ValueType &Actual, const ValueType &Expected)
 Logs an error if the two values are not the same object in memory. 更多...
 
bool TestTrue (const TCHAR *What, bool Value)
 Logs an error if the specified Boolean value is not true. 更多...
 
template<typename ValueType >
bool TestValid (const TCHAR *Description, const TSharedPtr< ValueType > &SharedPointer)
 Logs an error if the given shared pointer is not valid. 更多...
 
virtual ~FAutomationTestBase ()
 Destructor
 

Protected 成员函数

virtual FString GetBeautifiedTestName () const =0
 Returns the beautified test name
 
virtual void GetTests (TArray< FString > &OutBeautifiedNames, TArray< FString > &OutTestCommands) const =0
 Asks the test to enumerate variants that will all go through the "RunTest" function with different parameters (for load all maps, this should enumerate all maps to load)\ 更多...
 
virtual bool RunTest (const FString &Parameters)=0
 Virtual call to execute the automation test. 更多...
 
virtual void SetTestContext (FString Context)
 Sets the parameter context of the test.
 

Protected 属性

bool bSuppressLogs
 Flag to suppress logs
 
FAutomationTestExecutionInfo ExecutionInfo
 Info related to the last execution of this test
 
FString TestName
 Name of the test
 
FString TestParameterContext
 Context of the test
 

友元

class FAutomationTestFramework
 

详细描述

Simple abstract base class for all automation tests

构造及析构函数说明

◆ FAutomationTestBase()

FAutomationTestBase::FAutomationTestBase ( const FString &  InName,
const bool  bInComplexTask 
)
inline

Constructor

参数
InNameName of the test

成员函数说明

◆ AddAnalyticsItem()

virtual void FAutomationTestBase::AddAnalyticsItem ( const FString &  InAnalyticsItem)
virtual

Adds a analytics string to parse later

参数
InLogItemLog item to add to this test

◆ AddError()

virtual void FAutomationTestBase::AddError ( const FString &  InError,
int32  StackOffset = 0 
)
virtual

Adds an error message to this test

参数
InErrorError message to add to this test

◆ AddErrorIfFalse()

virtual void FAutomationTestBase::AddErrorIfFalse ( bool  bCondition,
const FString &  InError,
int32  StackOffset = 0 
)
virtual

Adds an error message to this test if the condition is false

参数
bConditionThe condition to validate.
InErrorError message to add to this test

◆ AddErrorS()

virtual void FAutomationTestBase::AddErrorS ( const FString &  InError,
const FString &  InFilename,
int32  InLineNumber 
)
virtual

Adds an error message to this test

参数
InErrorError message to add to this test
InFilenameThe filename the error originated in
InLineNumberThe line number in the file this error originated in

◆ AddEvent()

virtual void FAutomationTestBase::AddEvent ( const FAutomationEvent &  InEvent,
int32  StackOffset = 0 
)
virtual

Adds an automation event directly into the execution log.

参数
InLogItemLog item to add to this test

◆ AddExpectedError()

void FAutomationTestBase::AddExpectedError ( FString  ExpectedPatternString,
EAutomationExpectedErrorFlags::MatchType  CompareType = EAutomationExpectedErrorFlags::Contains,
int32  Occurrences = 1 
)

Adds a regex pattern to an internal list that this test will expect to encounter in error or warning logs during its execution.

If an expected pattern is not encountered, it will cause this test to fail.

参数
ExpectedPatternString- The expected message string. Supports basic regex patterns.
CompareType- How to match this string with an encountered error, should it match exactly or simply just contain the string.
Occurrences- How many times to expect this error string to be seen. If > 0, the error must be seen the exact number of times specified or the test will fail. If == 0, the error must be seen one or more times (with no upper limit) or the test will fail.

◆ AddInfo()

virtual void FAutomationTestBase::AddInfo ( const FString &  InLogItem,
int32  StackOffset = 0 
)
virtual

Adds a log item to this test

参数
InLogItemLog item to add to this test

◆ AddWarning()

virtual void FAutomationTestBase::AddWarning ( const FString &  InWarning,
int32  StackOffset = 0 
)
virtual

Adds a warning to this test

参数
InWarningWarning message to add to this test

◆ AddWarningS()

virtual void FAutomationTestBase::AddWarningS ( const FString &  InWarning,
const FString &  InFilename,
int32  InLineNumber 
)
virtual

Adds an warning message to this test

参数
InWarningWarning message to add to this test
InFilenameThe filename the error originated in
InLineNumberThe line number in the file this error originated in

◆ ElevateLogWarningsToErrors()

virtual bool FAutomationTestBase::ElevateLogWarningsToErrors ( )
inlinevirtual

If returns true then logging with a level of Warning will be treated as an error

返回
true to make warnings errors

◆ GetExecutionInfo()

void FAutomationTestBase::GetExecutionInfo ( FAutomationTestExecutionInfo &  OutInfo) const

Populate the provided execution info object with the execution info contained within the test.

Not particularly efficient, but providing direct access to the test's private execution info could result in errors.

参数
OutInfoExecution info to be populated with the same data contained within this test's execution info

◆ GetExpectedErrors()

void FAutomationTestBase::GetExpectedErrors ( TArray< FAutomationExpectedError > &  OutInfo) const

Populate the provided expected errors object with the expected errors contained within the test.

Not particularly efficient, but providing direct access to the test's private execution errors list could result in errors.

参数
OutInfo- Array of Expected Errors to be populated with the same data contained within this test's expected errors list

◆ GetRequiredDeviceNum()

virtual uint32 FAutomationTestBase::GetRequiredDeviceNum ( ) const
pure virtual

Pure virtual method; returns the number of participants for this test

返回
Number of required participants

◆ GetTestFlags()

virtual uint32 FAutomationTestBase::GetTestFlags ( ) const
pure virtual

Pure virtual method; returns the flags associated with the given automation test

返回
Automation test flags associated with the test

◆ GetTests()

virtual void FAutomationTestBase::GetTests ( TArray< FString > &  OutBeautifiedNames,
TArray< FString > &  OutTestCommands 
) const
protectedpure virtual

Asks the test to enumerate variants that will all go through the "RunTest" function with different parameters (for load all maps, this should enumerate all maps to load)\

参数
OutBeautifiedNames- Name of the test that can be displayed by the UI (for load all maps, it would be the map name without any directory prefix)
OutTestCommands- The parameters to be specified to each call to RunTests (for load all maps, it would be the map name to load)

◆ HasAnyErrors()

bool FAutomationTestBase::HasAnyErrors ( ) const

Returns whether this test has any errors associated with it or not

返回
true if this test has at least one error associated with it; false if not

◆ HasMetExpectedErrors()

bool FAutomationTestBase::HasMetExpectedErrors ( )

Returns whether this test has encountered all expected errors defined for it

返回
true if this test has encountered all expected errors; false if not

◆ IsComplexTask()

const bool FAutomationTestBase::IsComplexTask ( ) const
inline

Is this a complex tast - if so it will be a stress test.

返回
true if this is a complex task.

◆ RunTest()

virtual bool FAutomationTestBase::RunTest ( const FString &  Parameters)
protectedpure virtual

Virtual call to execute the automation test.


参数
Parameters- Parameter list for the test (but it will be empty for simple tests)
返回
TRUE if the test was run successfully; FALSE otherwise

◆ SetSuccessState()

void FAutomationTestBase::SetSuccessState ( bool  bSuccessful)

Forcibly sets whether the test has succeeded or not

参数
bSuccessfultrue to mark the test successful, false to mark the test as failed

◆ SuppressLogErrors()

virtual bool FAutomationTestBase::SuppressLogErrors ( )
inlinevirtual

If returns true then logging with a level of Error will not be recorded in test results

返回
false to make errors errors

◆ SuppressLogs()

virtual bool FAutomationTestBase::SuppressLogs ( )
inlinevirtual

If true no logging will be included in test events

返回
true to suppress logs

◆ SuppressLogWarnings()

virtual bool FAutomationTestBase::SuppressLogWarnings ( )
inlinevirtual

If returns true then logging with a level of Warning will not be recorded in test results

返回
true to make warnings errors

◆ TestEqual()

template<typename ValueType >
bool FAutomationTestBase::TestEqual ( const TCHAR *  What,
const ValueType &  Actual,
const ValueType &  Expected 
)
inline

Logs an error if the two values are not equal.

参数
What- Description text for the test.
A- The first value.
B- The second value.
参见
TestNotEqual

◆ TestFalse()

bool FAutomationTestBase::TestFalse ( const TCHAR *  What,
bool  Value 
)

Logs an error if the specified Boolean value is not false.

参数
What- Description text for the test.
Value- The value to test.
参见
TestFalse

◆ TestInvalid()

template<typename ValueType >
bool FAutomationTestBase::TestInvalid ( const TCHAR *  Description,
const TSharedPtr< ValueType > &  SharedPointer 
)
inline

Logs an error if the given shared pointer is valid.

参数
Description- Description text for the test.
SharedPointer- The shared pointer to test.
参见
TestValid

◆ TestNotEqual()

template<typename ValueType >
bool FAutomationTestBase::TestNotEqual ( const TCHAR *  Description,
const ValueType &  Actual,
const ValueType &  Expected 
)
inline

Logs an error if the two values are equal.

参数
Description- Description text for the test.
A- The first value.
B- The second value.
参见
TestEqual

◆ TestNotNull()

template<typename ValueType >
bool FAutomationTestBase::TestNotNull ( const TCHAR *  What,
ValueType *  Pointer 
)
inline

Logs an error if the specified pointer is NULL.

参数
What- Description text for the test.
Pointer- The pointer to test.
参见
TestNull

◆ TestNotSame()

template<typename ValueType >
bool FAutomationTestBase::TestNotSame ( const TCHAR *  Description,
const ValueType &  Actual,
const ValueType &  Expected 
)
inline

Logs an error if the two values are the same object in memory.

参数
Description- Description text for the test.
A- The first value.
B- The second value.
参见
TestSame

◆ TestNull()

bool FAutomationTestBase::TestNull ( const TCHAR *  What,
const void *  Pointer 
)

Logs an error if the specified pointer is not NULL.

参数
Description- Description text for the test.
Pointer- The pointer to test.
参见
TestNotNull

◆ TestSame()

template<typename ValueType >
bool FAutomationTestBase::TestSame ( const TCHAR *  Description,
const ValueType &  Actual,
const ValueType &  Expected 
)
inline

Logs an error if the two values are not the same object in memory.

参数
Description- Description text for the test.
Actual- The actual value.
Expected- The expected value.
参见
TestNotSame

◆ TestTrue()

bool FAutomationTestBase::TestTrue ( const TCHAR *  What,
bool  Value 
)

Logs an error if the specified Boolean value is not true.

参数
Description- Description text for the test.
Value- The value to test.
参见
TestFalse

◆ TestValid()

template<typename ValueType >
bool FAutomationTestBase::TestValid ( const TCHAR *  Description,
const TSharedPtr< ValueType > &  SharedPointer 
)
inline

Logs an error if the given shared pointer is not valid.

参数
Description- Description text for the test.
SharedPointer- The shared pointer to test.
参见
TestInvalid

该类的文档由以下文件生成: