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
|
inline |
Constructor
| InName | Name of the test |
|
virtual |
Adds a analytics string to parse later
| InLogItem | Log item to add to this test |
|
virtual |
Adds an error message to this test
| InError | Error message to add to this test |
|
virtual |
Adds an error message to this test if the condition is false
| bCondition | The condition to validate. |
| InError | Error message to add to this test |
|
virtual |
Adds an error message to this test
| InError | Error message to add to this test |
| InFilename | The filename the error originated in |
| InLineNumber | The line number in the file this error originated in |
|
virtual |
Adds an automation event directly into the execution log.
| InLogItem | Log item to add to this test |
| 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. |
|
virtual |
Adds a log item to this test
| InLogItem | Log item to add to this test |
|
virtual |
Adds a warning to this test
| InWarning | Warning message to add to this test |
|
virtual |
Adds an warning message to this test
| InWarning | Warning message to add to this test |
| InFilename | The filename the error originated in |
| InLineNumber | The line number in the file this error originated in |
|
inlinevirtual |
If returns true then logging with a level of Warning will be treated as an error
| 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.
| OutInfo | Execution info to be populated with the same data contained within this test's execution info |
| 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 |
|
pure virtual |
Pure virtual method; returns the number of participants for this test
|
pure virtual |
Pure virtual method; returns the flags associated with the given automation test
|
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) |
| bool FAutomationTestBase::HasAnyErrors | ( | ) | const |
Returns whether this test has any errors associated with it or not
| bool FAutomationTestBase::HasMetExpectedErrors | ( | ) |
Returns whether this test has encountered all expected errors defined for it
|
inline |
Is this a complex tast - if so it will be a stress test.
|
protectedpure virtual |
Virtual call to execute the automation test.
| Parameters | - Parameter list for the test (but it will be empty for simple tests) |
| void FAutomationTestBase::SetSuccessState | ( | bool | bSuccessful | ) |
Forcibly sets whether the test has succeeded or not
| bSuccessful | true to mark the test successful, false to mark the test as failed |
|
inlinevirtual |
If returns true then logging with a level of Error will not be recorded in test results
|
inlinevirtual |
If true no logging will be included in test events
|
inlinevirtual |
If returns true then logging with a level of Warning will not be recorded in test results
|
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. |
| 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. |
|
inline |
Logs an error if the given shared pointer is valid.
| Description | - Description text for the test. |
| SharedPointer | - The shared pointer to test. |
|
inline |
Logs an error if the two values are equal.
| Description | - Description text for the test. |
| A | - The first value. |
| B | - The second value. |
|
inline |
Logs an error if the specified pointer is NULL.
| What | - Description text for the test. |
| Pointer | - The pointer to test. |
|
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. |
| 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. |
|
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. |
| 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. |
|
inline |
Logs an error if the given shared pointer is not valid.
| Description | - Description text for the test. |
| SharedPointer | - The shared pointer to test. |