Ark Server API (ASA) - Wiki
|
#include <AutomationTest.h>
Static Public Member Functions | |
static bool | LogCategoryMatchesSeverityInclusive (ELogVerbosity::Type Actual, ELogVerbosity::Type MaximumVerbosity) |
Protected Member Functions | |
virtual void | GetTests (TArray< FString > &OutBeautifiedNames, TArray< FString > &OutTestCommands) const =0 |
virtual bool | RunTest (const FString &Parameters)=0 |
virtual FString | GetBeautifiedTestName () const =0 |
virtual void | SetTestContext (FString Context) |
uint32 | ExtractAutomationTestFlags (FString InTagNotation) |
Protected Attributes | |
bool | bComplexTask |
bool | bRunOnSeparateThread |
bool | bSuppressLogs = false |
FString | TestName |
FString | TestParameterContext |
FAutomationTestExecutionInfo | ExecutionInfo |
Private Member Functions | |
bool | IsExpectedMessage (const FString &Message, const ELogVerbosity::Type &Verbosity=ELogVerbosity::All) |
void | InternalSetSuccessState (bool bSuccessful) |
Private Attributes | |
TArray< FAutomationExpectedMessage > | ExpectedMessages |
FCriticalSection | ActionCS |
Friends | |
class | FAutomationTestFramework |
Simple abstract base class for all automation tests
Definition at line 1243 of file AutomationTest.h.
|
inline |
Constructor
InName | Name of the test |
Definition at line 1251 of file AutomationTest.h.
|
inlinevirtual |
Destructor
Definition at line 1261 of file AutomationTest.h.
Adds a analytics string to parse later
InLogItem | Log item to add to this test |
|
inline |
Enqueues a new latent command.
Definition at line 1530 of file AutomationTest.h.
|
inline |
Enqueues a new latent network command.
Definition at line 1539 of file AutomationTest.h.
|
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. |
void FAutomationTestBase::AddExpectedMessage | ( | FString | ExpectedPatternString, |
EAutomationExpectedMessageFlags::MatchType | CompareType = EAutomationExpectedMessageFlags::Contains, | ||
int32 | Occurrences = 1 ) |
Adds a regex pattern to an internal list that this test will expect to encounter in logs (of all severities) 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 message, should it match exactly or simply just contain the string. |
Occurrences | - How many times to expect this message string to be seen. If > 0, the message must be seen the exact number of times specified or the test will fail. If == 0, the message must be seen one or more times (with no upper limit) or the test will fail. |
void FAutomationTestBase::AddExpectedMessage | ( | FString | ExpectedPatternString, |
ELogVerbosity::Type | ExpectedVerbosity, | ||
EAutomationExpectedMessageFlags::MatchType | CompareType = EAutomationExpectedMessageFlags::Contains, | ||
int32 | Occurrences = 1 ) |
Adds a regex pattern to an internal list that this test will expect to encounter in logs (of the specified verbosity) 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. |
ExpectedVerbosity | - The expected message verbosity. This is treated as a minimum requirement, so for example the Warning level will intercept Warnings, Errors and Fatal. |
CompareType | - How to match this string with an encountered message, should it match exactly or simply just contain the string. |
Occurrences | - How many times to expect this message string to be seen. If > 0, the message must be seen the exact number of times specified or the test will fail. If == 0, the message 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 telemetry data point measurement
DataPoint | Name of the Data point |
Measurement | Value to associate to the data point |
Context | optional context associated with the data point |
|
virtual |
Adds several telemetry data point measurements
ValuePairs | value pair of Name and Measurement of several Data points |
Context | optional context associated with the data point |
|
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 |
void FAutomationTestBase::ClearExecutionInfo | ( | ) |
Clear any execution info/results from a prior running of this test
If returns true then logging with a level of Warning will be treated as an error
Definition at line 1525 of file AutomationTest.h.
Extracts a combined EAutomationTestFlags value from a string representation using tag notation "[Filter_1]...[Filter_n][Tag_1]...[Tag_m]"
void FAutomationTestBase::GenerateTestNames | ( | TArray< FAutomationTestInfo > & | TestInfo | ) | const |
Helper function that will generate a list of sub-tests via GetTests
Returns the beautified test name
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::GetExpectedMessages | ( | TArray< FAutomationExpectedMessage > & | OutInfo, |
ELogVerbosity::Type | Verbosity = ELogVerbosity::All ) const |
Populate the provided expected log messages object with the expected messages contained within the test. Not particularly efficient, but providing direct access to the test's private execution messages list could result in errors.
Verbosity | - Optionally filter the returned messages by verbosity. This is inclusive, so Warning will return Warnings, Errors, etc. |
OutInfo | - Array of Expected Messages to be populated with the same data contained within this test's expected messages list |
bool FAutomationTestBase::GetLastExecutionSuccessState | ( | ) |
Return the last success state for this test
Pure virtual method; returns the number of participants for this test
Implemented in FAutomationSpecBase.
|
inline |
[Deprecated] Return the last success state for this test
Definition at line 1419 of file AutomationTest.h.
|
inlinevirtual |
Allows navigation to the asset associated with the test if there is one.
Definition at line 1558 of file AutomationTest.h.
|
inline |
Gets the parameter context of the test.
Definition at line 1278 of file AutomationTest.h.
Pure virtual method; returns the flags associated with the given automation test
Returns the beautified test name with test context. Should return what is displayed in the Test Automation UI. See GenerateTestNames()
Definition at line 1283 of file AutomationTest.h.
|
inline |
Gets the C++ name of the test.
Definition at line 1275 of file AutomationTest.h.
|
inlinevirtual |
Return an exec command to open the test associated with this parameter.
Definition at line 1561 of file AutomationTest.h.
|
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) |
Implemented in FBDDAutomationTestBase, and FAutomationSpecBase.
Gets the line number where this test was defined.
Definition at line 1549 of file AutomationTest.h.
|
inlinevirtual |
Gets the line number where this test was defined.
Reimplemented in FAutomationSpecBase.
Definition at line 1555 of file AutomationTest.h.
Gets the filename where this test was defined.
Definition at line 1546 of file AutomationTest.h.
|
inlinevirtual |
Gets the filename where this test was defined.
Reimplemented in FAutomationSpecBase.
Definition at line 1552 of file AutomationTest.h.
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
bool FAutomationTestBase::HasMetExpectedMessages | ( | ELogVerbosity::Type | VerbosityType = ELogVerbosity::All | ) |
Returns whether this test has encountered all expected log messages defined for it
VerbosityType | Optionally specify to check by log level. Defaults to all. |
Sets whether the test has succeeded or not
bSuccessful | true to mark the test successful, false to mark the test as failed |
Is this a complex tast - if so it will be a stress test.
Definition at line 1486 of file AutomationTest.h.
|
private |
Returns whether this test has defined any expected log messages matching the given message. If a match is found, the expected message definition increments it actual occurrence count.
Definition at line 1491 of file AutomationTest.h.
|
static |
Helper function that determines if the given log category matches the expected category, inclusively (so an Error counts as a Warning)
|
inline |
Definition at line 1568 of file AutomationTest.h.
Definition at line 1563 of file AutomationTest.h.
Virtual call to execute the automation test.
Parameters | - Parameter list for the test (but it will be empty for simple tests) |
Implemented in FAutomationSpecBase, and FBDDAutomationTestBase.
[Deprecated] Use AddError(msg) instead to change the state of the test to a failure
Definition at line 1413 of file AutomationTest.h.
Set telemetry storage name
StorageName | Name of the data storage |
Sets the parameter context of the test.
Definition at line 1894 of file AutomationTest.h.
If returns true then logging with a level of Error will not be recorded in test results
Definition at line 1511 of file AutomationTest.h.
If true no logging will be included in test events
Definition at line 1501 of file AutomationTest.h.
If returns true then logging with a level of Warning will not be recorded in test results
Definition at line 1518 of file AutomationTest.h.
|
inline |
Definition at line 1610 of file AutomationTest.h.
|
inline |
Definition at line 1605 of file AutomationTest.h.
|
inline |
Definition at line 1676 of file AutomationTest.h.
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const double | Actual, | ||
const double | Expected, | ||
double | Tolerance = UE_KINDA_SMALL_NUMBER ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const FColor | Actual, | ||
const FColor | Expected ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const FLinearColor | Actual, | ||
const FLinearColor | Expected ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const float | Actual, | ||
const float | Expected, | ||
float | Tolerance = UE_KINDA_SMALL_NUMBER ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const FRotator | Actual, | ||
const FRotator | Expected, | ||
float | Tolerance = UE_KINDA_SMALL_NUMBER ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const FTransform | Actual, | ||
const FTransform | Expected, | ||
float | Tolerance = UE_KINDA_SMALL_NUMBER ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const FVector | Actual, | ||
const FVector | Expected, | ||
float | Tolerance = UE_KINDA_SMALL_NUMBER ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const int32 | Actual, | ||
const int32 | Expected ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const int64 | Actual, | ||
const int64 | Expected ) |
bool FAutomationTestBase::TestEqual | ( | const TCHAR * | What, |
const TCHAR * | Actual, | ||
const TCHAR * | 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. |
Definition at line 1665 of file AutomationTest.h.
bool FAutomationTestBase::TestEqualInsensitive | ( | const TCHAR * | What, |
const TCHAR * | Actual, | ||
const TCHAR * | Expected ) |
Logs an error if the specified Boolean value is not false.
What | - Description text for the test. |
Value | - The value to test. |
|
inline |
Definition at line 1715 of file AutomationTest.h.
|
inline |
Logs an error if the given shared pointer is valid.
Description | - Description text for the test. |
SharedPointer | - The shared pointer to test. |
Definition at line 1705 of file AutomationTest.h.
|
inline |
Definition at line 1739 of file AutomationTest.h.
|
inline |
Logs an error if the two values are equal.
Description | - Description text for the test. |
A | - The first value. |
B | - The second value. |
Definition at line 1729 of file AutomationTest.h.
|
inline |
Definition at line 1762 of file AutomationTest.h.
|
inline |
Logs an error if the specified pointer is NULL.
What | - Description text for the test. |
Pointer | - The pointer to test. |
Definition at line 1752 of file AutomationTest.h.
|
inline |
Definition at line 1786 of file AutomationTest.h.
|
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. |
Definition at line 1776 of file AutomationTest.h.
Logs an error if the specified pointer is not NULL.
Description | - Description text for the test. |
Pointer | - The pointer to test. |
|
inline |
Definition at line 1825 of file AutomationTest.h.
|
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. |
Definition at line 1815 of file AutomationTest.h.
Logs an error if the specified Boolean value is not true.
Description | - Description text for the test. |
Value | - The value to test. |
|
inline |
Definition at line 1866 of file AutomationTest.h.
|
inline |
Logs an error if the given shared pointer is not valid.
Description | - Description text for the test. |
SharedPointer | - The shared pointer to test. |
Definition at line 1856 of file AutomationTest.h.
|
friend |
Definition at line 1920 of file AutomationTest.h.
|
private |
Critical section lock
Definition at line 1942 of file AutomationTest.h.
|
protected |
Definition at line 1902 of file AutomationTest.h.
|
protected |
Definition at line 1905 of file AutomationTest.h.
Flag to suppress logs
Definition at line 1908 of file AutomationTest.h.
|
protected |
Info related to the last execution of this test
Definition at line 1917 of file AutomationTest.h.
|
private |
Definition at line 1939 of file AutomationTest.h.
|
protected |
Name of the test
Definition at line 1911 of file AutomationTest.h.
|
protected |
Context of the test
Definition at line 1914 of file AutomationTest.h.