Navigation
API > API/Plugins > API/Plugins/NetcodeUnitTest
Base class for all unit tests which launch child processes, whether they be UE child processes, or other arbitrary programs.
Handles management of child processes, memory usage tracking, log/stdout output gathering/printing, and crash detection.
| Name | UProcessUnitTest |
| Type | class |
| Header File | /Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/ProcessUnitTest.h |
| Include Path | #include "ProcessUnitTest.h" |
Syntax
UCLASS (Abstract)
class UProcessUnitTest : public UUnitTest
Inheritance Hierarchy
- FUnitLogInterface → UUnitTestBase → UUnitTest → UProcessUnitTest
- UObjectBase → UObjectBaseUtility → UObject → UUnitTestBase → UUnitTest → UProcessUnitTest
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UProcessUnitTest
(
const FObjectInitializer& ObjectInitializer |
UProcessUnitTest | ProcessUnitTest.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnSuspendStateChange | FOnSuspendStateChange | Delegate for notifying the UI, of a change in the unit test suspend state | ProcessUnitTest.h | |
| ProcessLogWatches | TArray< FProcessLogWatch > | Delegates for implementing process log watches | ProcessUnitTest.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void NotifyProcessFinished
(
TWeakPtr< FUnitTestProcess > InProcess |
Notifies when a running process is detected as having finished/closed NOTE: This will not get called, when ShutdownUnitTestProcess is used, only when a program ends by itself | ProcessUnitTest.h | |
virtual void NotifyProcessLog
(
TWeakPtr< FUnitTestProcess > InProcess, |
Interface for process unit tests For implementation in subclasses, for helping to verify success/fail upon completion of unit tests NOTE: Not called again once VerificationState is set WARNING: Be careful when iterating InLogLines in multiple different for loops, if the sequence of detected logs is important | ProcessUnitTest.h | |
virtual void NotifyProcessSuspendState
(
TWeakPtr< FUnitTestProcess > InProcess, |
Notifies when the suspend state of a process changes | ProcessUnitTest.h | |
virtual void NotifySuspendRequest() |
Notifies that there was a request to suspend/resume the unit test | ProcessUnitTest.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void CheckOutputForError
(
TSharedPtr< FUnitTestProcess > InProcess, |
Checks incoming process logs, for any indication of a crash/error | ProcessUnitTest.h | |
bool IsBlockingProcessPresent
(
bool bLogIfFound |
Whether or not a child process indicating a long/blocking task is running | ProcessUnitTest.h | |
void PollProcessOutput() |
Processes the standard output (i.e. log output) for processes | ProcessUnitTest.h | |
virtual void PrintUnitTestProcessErrors
(
TSharedPtr< FUnitTestProcess > InHandle |
If any errors logs were detected upon ShutdownUnitTestProcess, this is called to print them out | ProcessUnitTest.h | |
virtual void ShutdownUnitTestProcess
(
TSharedPtr< FUnitTestProcess > InHandle |
Shuts-down/cleans-up a child process tied to the unit test | ProcessUnitTest.h | |
virtual TWeakPtr< FUnitTestProcess > StartUEUnitTestProcess
(
FString InCommandline, |
Starts a child UE process, tied to the unit test | ProcessUnitTest.h | |
virtual TWeakPtr< FUnitTestProcess > StartUnitTestProcess
(
FString Path, |
Starts a child process, tied to the unit test | ProcessUnitTest.h | |
void UpdateProcessStats() |
Updates (and if necessary, saves) the memory stats for processes | ProcessUnitTest.h |
Overridden from UUnitTest
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void CleanupUnitTest
(
EUnitTestResetStage ResetStage |
Cleans up all items needing destruction, and removes the unit test from tracking, before deleting the unit test itself | ProcessUnitTest.h |
Overridden from UUnitTestBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsTickable() |
Must override in subclasses, that need ticking. | ProcessUnitTest.h | |
virtual void PostUnitTick
(
float DeltaTime |
For cleanup actions that should occur after the primary tick function is called | ProcessUnitTest.h | |
virtual void UnitTick
(
float DeltaTime |
Main tick function for the unit test | ProcessUnitTest.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void FinishDestroy() |
ProcessUnitTest.h | ||
virtual void ShutdownAfterError() |
ProcessUnitTest.h |