Navigation
Unreal Engine C++ API Reference > Plugins > NetcodeUnitTest
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UUnitTestManager
References
Module | NetcodeUnitTest |
Header | /Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/UnitTestManager.h |
Include | #include "UnitTestManager.h" |
Syntax
UCLASS&40;Config&61;UnitTest&41;
class UUnitTestManager :
public UObject,
public FTickableGameObject,
public FOutputDevice
Remarks
Manages centralized execution and tracking of unit tests, as well as handling console commands, and some misc tasks like local log hooking
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
TSharedPtr< SWindow > | AbortAllDialog | The 'abort all' dialog |
![]() ![]() |
TArray< TObjectPtr< UUnitTest > > | ActiveUnitTests | Holds a list of currently active unit tests |
![]() ![]() ![]() |
uint8 | AutoCloseMemoryPercent | As above, but when reaching this limit, recently started unit test(s) will be terminated/re-queued, to get back within limits |
![]() |
bool | bAbortedFirstRunUnitTest | If a unit test was aborted on its first run, strictly cap all first-run unit tests to one at a time |
![]() |
bool | bAllowRequeuingUnitTests | Whether or not to allow re-queuing of unit tests |
![]() ![]() ![]() |
bool | bCapUnitTestCount | Whether or not to cap the maximum number of unit tests that can be active at any given time |
![]() ![]() ![]() |
bool | bCapUnitTestMemory | Whether or not to cap active unit tests, based on memory usage |
![]() ![]() |
TArray< TObjectPtr< UUnitTest > > | FinishedUnitTests | Unit tests which are finished, and are kept around until printing the final summary |
![]() ![]() ![]() |
uint8 | MaxAutoCloseCount | Limits the number of auto-aborts a particular unit test will allow, before it is no longer accepted for re-queueing |
![]() ![]() ![]() |
uint8 | MaxMemoryPercent | When total physical memory usage, as a percentage, reaches this limit, no new unit tests can be started |
![]() ![]() ![]() |
uint8 | MaxUnitTestCount | Specifies the maximum number of unit tests that can be run at any given time |
![]() ![]() |
TArray< TObjectPtr< UClass > > | PendingUnitTests | Holds a list of unit tests pending execution |
![]() |
TUniquePtr< FOutputDeviceFile > | StatusLog | The log file for outputting overall unit test status |
![]() |
TSharedPtr< SLogWindow > | StatusWindow | The log window which displays the overall status of unit testing |
![]() ![]() ![]() |
uint32 | UnitTestSessionCount | The number of recorded sessions where UE has run unit tests (max one per each run of the UE process) |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UUnitTestManager
(
const FObjectInitializer& ObjectInitializer |
UUnitTestManager |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Destructor for handling removal of log registration |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | DumpStatus
(
bool bForce |
Dumps status information for running/pending unit tests, to the status window and log |
![]() |
bool | Exec
(
UWorld* InWorld, |
Handles exec commands starting with 'UnitTest' |
![]() ![]() |
UUnitTestManager * | Get () |
Static getter for the unit test manager |
![]() |
const FString | Returns the base log directory used by unit tests | |
![]() ![]() |
FSlateColor | ||
![]() |
void | Initialize () |
Initialize the unit test manager |
![]() |
void | Initialize unit test log output | |
![]() |
bool | Returns whether or not there are unit tests running (or about to be run) | |
![]() |
void | NotifyCloseAllDialogResult
(
const TSharedRef< SWindow >& DialogWindow, |
When the main status window is closed, a dialog pops up asking if you want to abort all running unit tests; this returns the result |
![]() |
void | NotifyCloseDialogResult
(
const TSharedRef< SWindow >& DialogWindow, |
When a log window is closed, a dialog pops up asking if the unit test should be aborted - this returns the result NOTE: This dialog is non-modal, i.e. doesn't block the game thread - so the unit test is not guaranteed to still exist |
![]() |
void | NotifyLogWindowClosed
(
const TSharedRef< SWindow >& ClosedWindow |
Notifies when a log window has closed |
![]() |
void | NotifyUnitTestCleanup
(
UUnitTest* InUnitTest |
Notification that is triggered when a unit test is cleaning up |
![]() |
void | NotifyUnitTestComplete
(
UUnitTest* InUnitTest, |
Notification that is triggered when a unit test completes |
![]() |
void | Opens the status log window | |
![]() |
void | OpenUnitTestLogWindow
(
UUnitTest* InUnitTest |
Opens the log window, for a unit test |
![]() |
void | Checks to see if we're ready to execute any unit tests in the queue, and if so, begins execution | |
![]() |
void | Prints the final unit test summary, when all active/pending unit tests have completed | |
![]() |
void | PrintUnitTestResult
(
UUnitTest* InUnitTest, |
Prints the results information for a single unit test |
![]() |
bool | QueueUnitTest
(
UClass* UnitTestClass, |
Queues a unit test for execution |
![]() ![]() |
void | Serialize
(
const TCHAR* Data, |
We're hiding UObject::Serialize() by declaring this. That's OK, but Clang will warn about it. |
![]() |
void | SetStatusColor
(
FSlateColor InStatusColor |
|
![]() |
void | SetStatusLog
(
bool bInStatusLog |
Getters/Setters |
![]() |
bool | WithinUnitTestLimits
(
UClass* PendingUnitTest |
Tests whether currently active unit tests, and optionally/additionally, a unit test about to be executed, fall within limits/restrictions on unit test counts and memory usage |
Overridden from FTickableGameObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
bool | Used to determine if an object should be ticked when the game is paused. |
Overridden from FTickableObjectBase
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
TStatId | GetStatId () |
Return the stat id to use for this tickable |
![]() ![]() ![]() |
bool | IsTickable () |
Must override in subclasses, that need ticking. |
![]() ![]() |
void | Tick
(
float DeltaTime |
FTickableGameObject methods |