Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/UnitTest.h |
Include |
#include "UnitTest.h" |
UCLASS(Abstract, Config=UnitTestStats)
class UUnitTest : public UUnitTestBase
Base class for all unit tests
Name | Description | ||
---|---|---|---|
|
bAborted |
Whether or not the unit test has aborted execution |
|
|
bCompleted |
Whether or not the unit test has completed |
|
|
bDeveloperMode |
Whether or not developer-mode has been enabled for this unit test (prevents it from ending execution) |
|
|
bFirstTimeStats |
Whether it's the first time this unit test has run, i.e. whether prior memory stats exist ( Not set until first tick) |
|
|
bObsolete |
Whether or not this unit test is obsolete - i.e. based on code no longer present in the game/engine |
|
|
bUnreliable |
Whether or not this unit test is unreliable, i.e. prone to giving incorrect/unexpected results, requiring multiple runs |
|
|
bWorkInProgress |
Whether or not this unit test is a 'work in progress', and should not be included in automated tests |
|
|
CurrentMemoryUsage |
The current realtime memory usage of the unit test |
|
|
ExpectedResult |
The unit test result we expect for each games codebase, i.e. whether we expect that the problem is fixed yet or not |
|
|
float |
LastExecutionTime |
The amount of time it took to execute the unit test the last time it was run |
|
double |
LastNetTick |
The time of the last NetTick event |
|
double |
LastTimeoutReset |
The last time that the unit test timeout was reset |
|
LastTimeoutResetEvent |
Every timeout reset specifies a string to identify/describe the event that triggered it, for tracking |
|
|
TSharedPtr< SLo... |
LogWindow |
The log window associated with this unit test |
|
PeakMemoryUsage |
Config variables Stores stats on the highest-ever reported memory usage, for this unit test - for estimating memory usage |
|
|
double |
StartTime |
The time at which execution of the unit test started |
|
StatusLogSummary |
Collects unit test status logs, that have been printed to the summary window |
|
|
double |
TimeoutExpire |
The time at which the unit test timeout will expire |
|
float |
TimeToPeakMem |
The amount of time it takes to reach 'PeakMemoryUsage' (or within 90% of its value) |
|
TUniquePtr< FOu... |
UnitLog |
The log file for outputting all log information for the current unit test |
|
UnitLogDir |
The log directory for this unit test |
|
|
UnitTasks |
UnitTask's which must be run before different stages of the unit test can execute |
|
|
UnitTaskState |
Marks the state of met unit task requirement flags and active unit task blocking flags |
|
|
UnitTestBugTrackIDs |
The bug tracking identifiers related to this unit test (e.g. TTP numbers) |
|
|
UnitTestCLs |
Source control changelists relevant to this unit test |
|
|
UnitTestDate |
The date this unit test was added to the project (for ordering in help command) |
|
|
UnitTestName |
Variables which should be specified by every subclass The name/command for this unit test (N.B. Must be set in class constructor) |
|
|
UnitTestTimeout |
The amount of time (in seconds), before the unit test should timeout and be marked as broken |
|
|
UnitTestType |
The type of unit test this is (e.g. bug/exploit) (N.B. Must be set in class constructor) |
|
|
VerificationState |
Whether or not the success or failure of the current unit test has been verified |
Name | Description | |
---|---|---|
|
UUnitTest ( |
Name | Description | ||
---|---|---|---|
|
AbortUnitTest() |
Aborts execution of the unit test, part-way through |
|
|
AddTask ( |
Adds a UnitTask to the unit test, during its configuration stage - to be completed before executing the unit test |
|
|
CanResetUnitTest() |
Whether or not this unit test supports resetting |
|
|
CleanupUnitTest ( |
Cleans up all items needing destruction, and removes the unit test from tracking, before deleting the unit test itself |
|
|
EndUnitTest() |
Called upon completion of the unit test (may not happen during same tick), for tearing down created worlds/connections/etc. |
|
|
ExecuteUnitTest() |
Executes the main unit test |
|
|
GetCommandContextList ( |
Outputs the list of console command contexts, that this unit test supports (which can include custom contexts in subclasses) |
|
|
GetExpectedLogTypes() |
Returns the type of log entries that this unit expects to output, for setting up log window filters (only needs to return values which affect what tabs are shown) |
|
|
EUnitTestVer... |
GetExpectedResult() |
Returns the expected result for the current game |
|
GetSupportedGames() |
Returns the list of supported games, for this unit test |
|
|
GetUnitTestDate() |
Returns the date this unit test was first added to the code |
|
|
GetUnitTestName() |
Returns the name/command, for the current unit test |
|
|
GetUnitTestTimeout() |
Returns the value of UnitTestTimeout |
|
|
GetUnitTestType() |
Returns the type of unit test (e.g. bug/exploit) |
|
|
HasStarted() |
Whether or not the unit test has started |
|
|
InitializeEnvironmentSettings() |
Finishes initializing unit test settings, that rely upon the current unit test environment being loaded |
|
|
InitializeLogs() |
Sets up the log directory and log output device instances. |
|
|
IsFirstTimeStats() |
Returns whether or not this is the first time the unit test has been run/collecting-stats |
|
|
IsTaskBlocking ( |
Determines whether or not a UnitTask is blocking the specified event |
|
|
LogComplete() |
Triggered upon unit test completion, for outputting that the unit test has completed - plus other unit test state information |
|
|
NotifyConsoleCommandRequest |
Notifies that there was a request to execute a console command for the unit test, which can occur in a specific context, e.g. for a unit test server, for a local minimal-client (within the unit test), or for a separate unit test client process |
|
|
NotifyDeveloperModeRequest ( |
Notifies that there was a request to enable/disable developer mode |
|
|
NotifyUnitTaskFailure |
Triggered when a UnitTask fails unrecoverably during execution |
|
|
ResetTimeout |
Resets the unit test timeout code - should be used liberally, within every unit test, when progress is made during execution |
|
|
ResetUnitTest ( |
Resets the unit test to its initial state, allowing it to restart from scratch |
|
|
UnblockEvents ( |
When events that were pending but blocked by a UnitTask, are unblocked, this function triggers them. |
|
|
ValidateUnitTestSettings ( |
Validate that the unit test settings/flags specified for this unit test, are compatible with one another, and that the engine settings/environment, support running the unit test. |
Name | Description | ||
---|---|---|---|
|
IsTickable() |
Must override in subclasses, that need ticking. |
|
|
NetTick() |
Tick function that runs at a tickrate of ~60 fps, for interacting with netcode (high UnitTick tickrate, can lead to net buffer overflows) |
|
|
PostUnitTick ( |
For cleanup actions that should occur after the primary tick function is called |
|
|
TickIsComplete ( |
Tick function for checking if the unit test is completed (happens after all above tick events) |
|
|
UnitTick ( |
Main tick function for the unit test |
|
|
UTStartUnitTest() |
Name | Description | ||
---|---|---|---|
|
IsConnectionLogSource ( |
Whether or not this log interface is the source of a UNetConnection - used for deciding where to direct, UNetConnection log hooks |
|
|
IsTimerLogSource ( |
Whether or not this log interface is the source of an FTimerManager delegate object, used for hooking logs triggered during global timer manager delegates. |
|
|
NotifyLocalLog ( |
For implementation in subclasses, for helping to track local log entries related to a unit test. |
|
|
NotifyStatusLog |
As above, except for log entries directed towards the Unit Test Status window. |
Name |
Description |
---|---|
NullUnitEnv |
The null unit test environment - for unit tests which support all games, due to requiring no game-specific features |
UnitEnv |
Runtime variables The unit test environment (not set until the current games unit test module is loaded - not set at all, if no such module) |