UProcessUnitTest

Base class for all unit tests which launch child processes, whether they be UE4 child processes, or other arbitrary programs.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

NetcodeUnitTest

Header

/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/ProcessUnitTest.h

Include

#include "ProcessUnitTest.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Abstract)
class UProcessUnitTest : public UUnitTest

Remarks

Base class for all unit tests which launch child processes, whether they be UE4 child processes, or other arbitrary programs.

Handles management of child processes, memory usage tracking, log/stdout output gathering/printing, and crash detection.

Variables

Name Description

Protected variable

TArray< TShared...

 

ActiveProcesses

Runtime variables Stores a reference to all running child processes tied to this unit test, for housekeeping

Protected variable

double

 

LastBlockingProcessCheck

Last time there was a check for processes blocking progress

Public variable

FOnSuspendState...

 

OnSuspendStateChange

Delegate for notifying the UI, of a change in the unit test suspend state

Public variable

TArray< FProces...

 

ProcessLogWatches

Delegates for implementing process log watches

Constructors

Name Description

Public function

UProcessUnitTest

(
    const FObjectInitializer& ObjectIn...
)

UProcessUnitTest

Functions

Name Description

Protected function Virtual

void

 

CheckOutputForError

(
    TSharedPtr< FUnitTestProcess > InPr...,
    const TArray< FString >& InLines
)

Checks incoming process logs, for any indication of a crash/error

Protected function

bool

 

IsBlockingProcessPresent

(
    bool bLogIfFound
)

Whether or not a child process indicating a long/blocking task is running

Public function Virtual

void

 

NotifyProcessFinished

(
    TWeakPtr< FUnitTestProcess > InProc...
)

Notifies when a running process is detected as having finished/closed

Public function Virtual

void

 

NotifyProcessLog

(
    TWeakPtr< FUnitTestProcess > InProc...,
    const TArray< FString >& InLogLine...
)

Interface for process unit tests For implementation in subclasses, for helping to verify success/fail upon completion of unit tests

Public function Virtual

void

 

NotifyProcessSuspendState

(
    TWeakPtr< FUnitTestProcess > InProc...,
    ESuspendState InSuspendState
)

Notifies when the suspend state of a process changes

Public function Virtual

void

 

NotifySuspendRequest()

Notifies that there was a request to suspend/resume the unit test

Protected function

void

 

PollProcessOutput()

Processes the standard output (i.e. log output) for processes

Protected function Virtual

void

 

PrintUnitTestProcessErrors

(
    TSharedPtr< FUnitTestProcess > InHa...
)

If any errors logs were detected upon ShutdownUnitTestProcess, this is called to print them out

Protected function Virtual

void

 

ShutdownUnitTestProcess

(
    TSharedPtr< FUnitTestProcess > InHa...
)

Shuts-down/cleans-up a child process tied to the unit test

Protected function Virtual

TWeakPtr< FU...

 

StartUE4UnitTestProcess

(
    FString InCommandline,
    bool bMinimized,
    EBuildTargetType Type
)

Starts a child UE4 process, tied to the unit test

Protected function Virtual

TWeakPtr< FU...

 

StartUnitTestProcess

(
    FString Path,
    FString InCommandline,
    bool bMinimized
)

Starts a child process, tied to the unit test

Protected function

void

 

UpdateProcessStats()

Updates (and if necessary, saves) the memory stats for processes

Overridden from UUnitTest

Name Description

Protected function Virtual

void

 

CleanupUnitTest

(
    EUnitTestResetStage ResetStage
)

Cleans up all items needing destruction, and removes the unit test from tracking, before deleting the unit test itself

Overridden from UUnitTestBase

Name Description

Protected function Virtual Const

bool

 

IsTickable()

Must override in subclasses, that need ticking.

Protected function Virtual

void

 

PostUnitTick

(
    float DeltaTime
)

For cleanup actions that should occur after the primary tick function is called

Protected function Virtual

void

 

UnitTick

(
    float DeltaTime
)

Main tick function for the unit test

Overridden from UObject

Name Description

Protected function Virtual

void

 

FinishDestroy()

Called to finish destroying the object.

Protected function Virtual

void

 

ShutdownAfterError()

After a critical error, perform any mission-critical cleanup, such as restoring the video mode orreleasing hardware resources.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss