Navigation
| Name | NetcodeUnitTest |
| Type | Plugin |
| Part of Plugins | Netcode Unit Test |
| Location | /Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/ |
| Module Build Rules | NetcodeUnitTest.Build.cs |
Classes
| Name | Remarks |
|---|---|
| ANUTActor | |
| FAssertHookDevice | Output device for replacing GError, and catching specific asserts so they don't crash the game. |
| FDynamicOutputDevice | Output device for allowing quick/dynamic creation of a customized output device, using lambda's passed to delegates |
| FExecuteOnServer | Delegate for executing a unit test function on the server |
| FFuncReflection | FFuncReflection - helper for quickly/concisely setting function parameters through reflection |
| FHookOutputDevice | Output device for hijacking/hooking an existing output device (e.g. to hijack GError, to block specific asserts) Inherit this class, to implement desired hook behaviour in subclass |
| FLogCommandManager | Log hook which executes console commands upon detecting certain log entries. |
| FLogHookManager | Generic log hook, for calling a hook function upon detecting a specific log entry |
| FLogStackTraceManager | A log hook, which watches the log for specified log entries, and ties them into the stack trace manager |
| FLogTraceManager | A log hook, which watches the log for specified log entries, and ties them into the stack trace manager |
| FLogWidgetCommands | Includes. |
| FLogWindowManager | Basic window manager, for handling tiling of unit test log windows. |
| FNetPropertyHook | Implements the actual hook for the above class |
| FNetworkNotifyHook | A delegate network notify class, to allow for easy inline-hooking. |
| FNUTModuleInterface | Includes. |
| FNUTStackTrace | A class for dumping a stack trace, upon encountering a specific piece of code |
| FProcessEventHook | Class for encapsulating ProcessEvent and general RPC hooks, implemented globally for each UWorld NOTE: Presently, all RPC hooks tied to UWorld's only hook client RPC's - global RPC hooks, hook both client and server RPC's |
| FScopedIncrementTraceIgnoreDepth | Used for adjusting the depth of ignore stack trace lines in FStackTraceManager |
| FScopedLog | Use this following code snippet, to execute the above function. |
| FScopedLogNet | Version of FScopedLog, for scoped logging of all netcode-related logs |
| FScopedLogSuppress | Version of FScopedLog, for suppressing instead of enabling log entries |
| FScopedNetNameReplace | Hooks netcode name serialization, in order to replace replication of a specific name, with another specified name, for the lifetime of the scoped instance |
| FScopedNetObjectReplace | Hooks netcode object serialization, in order to replace replication of a specific object, with another specified object, for the lifetime of the scoped instance |
| FScopedRPCParamReplace | Hooks the netcode serialization of a specific RPC parameter, in order to override the raw serialized param data with something else |
| FStackTraceManager | Manager for handling multiple debug stack traces on-the-fly, and allowing abstraction of stack traces, so you don't have to manually handle FNUTStackTrace objects (which can be complicated/bug-prone). |
| FUnitLogInterface | Implements an interface for using the UNIT_LOG etc. macros above, within a class |
| FUnitLogRedirect | Implements a UNIT_LOG interface, which redirects to another unit log interface (e.g. redirect MinimalClient UNIT_LOG's to a UnitTest) |
| FUnitTestEnvironment | Class for handling per-game implementation of unit test environmental defaults |
| FVMReflection | FVMReflection |
| FVMReflectionParser | FVMReflectionParser |
| FWorldTickHook | Class for hooking world tick events, and setting globals for log hooking |
| SLogWidget | |
| SLogWindow | |
| SMultiSelectTableRow | Includes. |
| UClientUnitTest | Base class for all unit tests depending upon a MinimalClient connecting to a server. |
| UIPClient | Includes. |
| UMinimalClient | Base class for implementing a barebones/stripped-down game client, capable of connecting to a regular game server, but stripped/locked-down so that the absolute minimum of client/server netcode functionality is executed, for connecting the client. |
| UNUTGlobals | Stores globals/static-variables for NetcodeUnitTest - for compatibility with hot reload |
| UPackedVectorTest | Includes. |
| UProcessUnitTest | Base class for all unit tests which launch child processes, whether they be UE child processes, or other arbitrary programs. |
| USteamClient | Basic unit test for verifying simple client connection to a server, using the Steam net driver. |
| UUnitTask | UnitTask's are used to implement supporting code for UnitTest's, for handling complex behind-the-scenes setup prior to test execution (e.g. primarily for implementing game-specific server/client environment setup), which is shared between many unit tests, and which is better to abstract-away from visibility in unit tests themselves, for code clarity. |
| UUnitTest | Base class for all unit tests |
| UUnitTestActorChannel | An actor net channel override, for hooking ReceivedBunch, to aid in detecting/blocking of remote actors, of a specific class |
| UUnitTestBase | Includes. |
| UUnitTestChannel | A net channel for overriding the implementation of traditional net channels, for e.g. blocking control channel messages, to enable minimal clients |
| UUnitTestCommandlet | Includes. |
| UUnitTestManager | Manages centralized execution and tracking of unit tests, as well as handling console commands, and some misc tasks like local log hooking |
| UUnitTestPackageMap | Package map override, for blocking the creation of actor channels for specific actors (by detecting the actor class being created) |
| UVMReflection | Internal unit test for verifying the functionality of the UScript/BP VM reflection helper |
| UVMTestClassA | Test classes for testing different types/combinations of property reflection |
| UVMTestClassB | |
| UWebSocketClient | Basic unit test for verifying simple client connection to a server, using the WebSocket net driver. |
Structs
| Name | Remarks |
|---|---|
| AccessPrivate | This template, is used to link an arbitrary class member, to the GetPrivate function. |
| FContextPointer | There is a problem with the parser API, where the Context you pass into the Evaluate function is marked: const ContextType* Context |
| FErrorLog | Struct used for storing and classifying each log error line |
| FLogGridEntry | Struct representing a grid location for a log window |
| FLogLine | Struct representing a log line |
| FLogTabInfo | Struct containing tab-specific information |
| FMinClientHooks | Delegate hooks for the minimal client - also directly inherited by UMinimalClient |
| FMinClientParms | Parameters for configuring the minimal client - also directly inherited by UMinimalClient |
| FProtMinClientHooks | |
| FProtMinClientParms | Sidestep header parser enforcement of 'public' on inheritance below. |
| FReflEvaluationContext | FVMReflectionParser - A string interface for FVMReflection, which performs reflection on the UE virtual machine. |
| FStackTrackerbIsEnabledAccessor | Enable access to FStackTracker.bIsEnabled. |
| FTestResultPointer | |
| FUnitStatusLog | Structs Used for storing unit-test-specific logs, which are displayed in the status window (upon completion of unit testing, a final summary is printed using this data, but in a more-ordered/easier-to-read fashion) |
| FUnitTestProcess | Struct used for handling a launched UE client/server process |
| NUTDebug | General debug functions |
| NUTNet | Netcode based utility functions |
| NUTUtil | General utility functions |
| NUTUtilRefl | NUTUtilRefl - general reflection helper utility functions |
Interfaces
| Name | Remarks |
|---|---|
| INetcodeUnitTest | Public interface for the NetcodeUnitTest module |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FLogHook | TUniqueFunction< void(const TCHAR *, ELogVerbosity::Type, const class FName &)> | Function to call as the log hook | NUTUtilDebug.h |
| FLogHookID | int32 | Log hook ID, for removing later if desired | NUTUtilDebug.h |
| FMultiOnWindowClosed | TMulticastDelegate_OneParam< void, const TSharedRef< SWindow > & > | Setup a multicast version of the standard OnWindowClosed delegate | UI/SLogWindow.h |
| FOnConsoleCommand | TBaseDelegate_TwoParams< bool, FString, FString > | Delegate for passing on console commands from the UI, to the unit test | UI/SLogWidget.h |
| FOnDeveloperClicked | TBaseDelegate_OneParam< void, bool > | Delegate for passing on 'developer' mode checkbox clicks | UI/SLogWidget.h |
| FOnHandleClientPlayer | TBaseDelegate_TwoParams< void, APlayerController *, UNetConnection * > | Delegate for hooking the HandlerClientPlayer event | MinimalClient.h |
| FOnLogDialogResult | TBaseDelegate_ThreeParams< void, const TSharedRef< SWindow > &, EAppReturnType::Type, bool > | Warning: Currently all 'window close' events for the dialog are treated as user input, so be careful if closing within code (best to call SetOnWindowClosed(FOnWindowClosed()) prior to calling) Result callback delegate, for below function | UI/SLogDialog.h |
| FOnMinClientConnected | TBaseDelegate_NoParams< void > | Delegate for marking the minimal client as having connected fully | MinimalClient.h |
| FOnMinClientNetActor | TBaseDelegate_TwoParams< void, UActorChannel *, AActor * > | Delegate for notifying AFTER an actor channel actor has been created | MinimalClient.h |
| FOnMinClientNetworkFailure | TBaseDelegate_TwoParams< void, ENetworkFailure::Type, const FString & > | Delegate for passing back a network connection failure | MinimalClient.h |
| FOnMinClientReceivedControlBunch | TBaseDelegate_OneParam< void, FInBunch & > | Delegate for hooking the control channel's 'ReceivedBunch' call | MinimalClient.h |
| FOnMinClientReceivedRawPacket | TBaseDelegate_TwoParams< void, void *, int32 & > | Delegate for hooking the net connections 'ReceivedRawPacket' | MinimalClient.h |
| FOnMinClientRepActorSpawn | TBaseDelegate_ThreeParams< void, UClass *, bool, bool & > | Delegate for notifying on (and optionally blocking) replicated actor creation | MinimalClient.h |
| FOnNetSerializeItem | TBaseDelegate_FourParams< bool, FArchive &, UPackageMap *, void *, TArray< uint8 > * > | Delegate used to control hooked serialization of RPC parameters | Net/NUTUtilNet.h |
| FOnProcessNetEvent | TBaseDelegate_FourParams< void, AActor *, UFunction *, void *, bool & > | Delegate used to control/block receiving of RPC's | Net/NUTUtilNet.h |
| FOnRPCFailure | TBaseDelegate_NoParams< void > | Delegate for notifying of failure during call of SendRPCChecked | MinimalClient.h |
| FOnSerializeName | TMulticastDelegate_FourParams< void, bool, bool &, FArchive &, FName & > | Delegate for hooking SerializeName | Net/UnitTestPackageMap.h |
| FOnSuspendClicked | TBaseDelegate_NoParams< void > | Delegate for neatly passing on suspend/resume button click | UI/SLogWidget.h |
| FOnSuspendStateChange | TBaseDelegate_OneParam< void, ESuspendState > | Delegate notifying that a process suspend state has changed | ProcessUnitTest.h |
| FProcessLogWatch | TBaseDelegate_TwoParams< bool, TWeakPtr< FUnitTestProcess >, const TArray< FString > & > | Delegate for implementing process log watches | ProcessUnitTest.h |
Enums
Public
| Name | Remarks |
|---|---|
| EErrorLogStage | Includes. |
| ELogTraceFlags | Flags specifying the type of log trace |
| ELogType | Enums Used to help identify what type of log is being processed |
| EMinClientFlags | Flags for configuring the minimal client, what parts of the netcode should be enabled etc. |
| ENUTControlCommand | Enum for defining custom NetcodeUnitTest control channel commands (sent through NMT_NUTControl) |
| ESuspendState | Enum for specifying the suspend state of a process (typically the server) |
| EUnitTaskFlags | Enums Flags for specifying the required conditions for executing a UnitTask, and what stages of the unit test to block until completion |
| EUnitTestFlags | Flags for configuring how individual unit tests make use of the base client unit test framework. |
| EUnitTestResetStage | The different stages that unit tests can be reset to - a global/non-locally-customizable list, for now NOTE: Stages MUST be sequential! (e.g. ResetConnection implies ResetExecute, FullReset implies both ResetConnection and ResetExecute) NOTE: Apart from checking for 'None', all comparisons should be either <= or >=, to support potential enum additions |
| EUnitTestVerification | Enums The verification status of the current unit test - normally its execution completes immediately after positive/negative verification |
| EVMRefWarning | FVMReflection - Reflection Helper |
| UE::NUT::ELogHookType | Specifies the type of log hook (e.g. type of string matching to use) |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| GActiveLogEngineEvent | FUnitLogInterface * | UnitLogging.h | ||
| GActiveLogInterface | FUnitLogInterface * | Globals Used by to aid in hooking log messages triggered by unit tests |
Globals | UnitLogging.h | |
| GActiveLogTypeFlags | ELogType | The current ELogType flag modifiers, associated with a UNIT_LOG or UNIT_STATUS_LOG/STATUS_LOG call | UnitLogging.h | |
| GActiveLogWorld | UWorld * | UnitLogging.h | ||
| GActiveReceiveUnitConnection | UNetConnection * | Keeps track of the UUnitTestNetConnection, currently processing received data (to aid with selective log hooking) | UnitLogging.h | |
| GIsInitializingActorChan | bool | Whether not an actor channel, is in the process of initializing the remote actor |
Globals | NetcodeUnitTest.h | |
| GLogTraceManager | PRAGMA_DISABLE_DEPRECATION_WARNINGSFLogStackTraceManager * | Log hook for managing tying of log entry detection to the trace manager | NUTUtilDebug.h | |
| GTraceManager | FStackTraceManager * | Provides a globally accessible trace manager, for easy access to stack trace debugging |
Globals | NUTUtilDebug.h | |
| GUnitTestManager | UUnitTestManager * | Globals/externs Holds a reference to the object in charge of managing unit tests | NetcodeUnitTest.h | |
| UnitTestEnvironments | TMap< FString, FUnitTestEnvironment * > | The list of registered unit test environments, mapped to game name (unit test modules should add to this, within StartupModule) | UnitTestEnvironment.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
EMinClientFlags FromUnitTestFlags
(
EUnitTestFlags Flags |
Converts any EUnitTestFlags values, to their EMinClientFlags equivalentEMinClientFlags | NUTEnum.h | |
int32 GetUnitTaskPriority
(
EUnitTaskFlags InFlags |
Returns the numeric priority for the specified UnitTask flagsEUnitTaskFlags | UnitTask.h | |
FString GetUnitTestFlagName
(
EUnitTestFlags Flag |
Used to get name values for the above enumEUnitTestFlags | NUTEnum.h | |
FString GetUnitTestResetStageName
(
EUnitTestResetStage Stage |
EUnitTestResetStage | UnitTest.h | |
bool GGlobalExec
(
UWorld* InWorld, |
Provides a globally-accessible wrapper for the Exec function, which all modules can use (including those that don't inherit Engine), for executing console commands - useful for debugging e.g. pre-Engine netcode (such as the PacketHandler code). | NUTUtilDebug.h | |
TSharedRef< SWindow > OpenLogDialog_NonModal
(
EAppMsgType::Type InMessageType, |
Opens a non-modal/non-blocking message box, which returns its result through a delegate/callback, using a reference to the created window, to identify which dialog has returned a result (in case there are multiple dialog windows) | UI/SLogDialog.h | |
TSharedRef< SWindow > OpenLogDialog_NonModal
(
EAppMsgType::Type InMessageType, |
UI/SLogDialog.h | ||
bool operator!
(
EUnitTaskFlags E |
UnitTask.h | ||
bool operator!
(
EMinClientFlags E |
NUTEnum.h | ||
bool operator!
(
EUnitTestFlags E |
NUTEnum.h | ||
bool operator!
(
ELogTraceFlags E |
NUTUtilDebug.h | ||
| UnitLogging.h | |||
EUnitTaskFlags operator&
(
EUnitTaskFlags Lhs, |
UnitTask.h | ||
EMinClientFlags operator&
(
EMinClientFlags Lhs, |
NUTEnum.h | ||
EUnitTestFlags operator&
(
EUnitTestFlags Lhs, |
NUTEnum.h | ||
ELogTraceFlags operator&
(
ELogTraceFlags Lhs, |
NUTUtilDebug.h | ||
| UnitLogging.h | |||
EUnitTaskFlags & operator&=
(
EUnitTaskFlags& Lhs, |
UnitTask.h | ||
EMinClientFlags & operator&=
(
EMinClientFlags& Lhs, |
NUTEnum.h | ||
EUnitTestFlags & operator&=
(
EUnitTestFlags& Lhs, |
NUTEnum.h | ||
ELogTraceFlags & operator&=
(
ELogTraceFlags& Lhs, |
NUTUtilDebug.h | ||
ELogType & operator&=
(
ELogType& Lhs, |
UnitLogging.h | ||
EUnitTaskFlags operator^
(
EUnitTaskFlags Lhs, |
UnitTask.h | ||
EMinClientFlags operator^
(
EMinClientFlags Lhs, |
NUTEnum.h | ||
EUnitTestFlags operator^
(
EUnitTestFlags Lhs, |
NUTEnum.h | ||
ELogTraceFlags operator^
(
ELogTraceFlags Lhs, |
NUTUtilDebug.h | ||
| UnitLogging.h | |||
EUnitTaskFlags & operator^=
(
EUnitTaskFlags& Lhs, |
UnitTask.h | ||
EMinClientFlags & operator^=
(
EMinClientFlags& Lhs, |
NUTEnum.h | ||
EUnitTestFlags & operator^=
(
EUnitTestFlags& Lhs, |
NUTEnum.h | ||
ELogTraceFlags & operator^=
(
ELogTraceFlags& Lhs, |
NUTUtilDebug.h | ||
ELogType & operator^=
(
ELogType& Lhs, |
UnitLogging.h | ||
EUnitTaskFlags operator|
(
EUnitTaskFlags Lhs, |
UnitTask.h | ||
EMinClientFlags operator|
(
EMinClientFlags Lhs, |
NUTEnum.h | ||
EUnitTestFlags operator|
(
EUnitTestFlags Lhs, |
NUTEnum.h | ||
ELogTraceFlags operator|
(
ELogTraceFlags Lhs, |
NUTUtilDebug.h | ||
| UnitLogging.h | |||
EUnitTaskFlags & operator|=
(
EUnitTaskFlags& Lhs, |
UnitTask.h | ||
EMinClientFlags & operator|=
(
EMinClientFlags& Lhs, |
Required for bitwise operations with the above enum. | NUTEnum.h | |
EUnitTestFlags & operator|=
(
EUnitTestFlags& Lhs, |
Required for bitwise operations with the above enum. | NUTEnum.h | |
ELogTraceFlags & operator|=
(
ELogTraceFlags& Lhs, |
NUTUtilDebug.h | ||
ELogType & operator|=
(
ELogType& Lhs, |
UnitLogging.h | ||
| UnitTask.h | |||
| NUTEnum.h | |||
| NUTEnum.h | |||
| NUTUtilDebug.h | |||
| UnitLogging.h | |||
| Macro defines Helper function, for macro defines - allows the 'UnitLogTypeFlags' macro parameters below, to be optional | UnitLogging.h | ||
EMinClientFlags ValidateMinFlags
(
EMinClientFlags RuntimeFlags |
Validates, both at compile time (template param) or at runtime (function param), that the specified EMinClientFlags flags are valid. | NUTEnum.h |