Files
UnrealEngineUWP/Engine/Source/Developer/FunctionalTesting/Classes/FunctionalTestBase.h
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

78 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Misc/AutomationTest.h"
/**
* Base class for Functional test cases.
*/
class FUNCTIONALTESTING_API FFunctionalTestBase : public FAutomationTestBase
{
public:
FFunctionalTestBase(const FString& InName, const bool bInComplexTask);
/**
* If true logs will not be included in test events
*
* @return true to suppress logs
*/
virtual bool SuppressLogs()
{
return bSuppressLogs || !IsFunctionalTestRunning();
}
/**
* Specify how log errors & warnings should be handled during tests. If values are not set then the project
* defaults will be used.
*/
void SetLogErrorAndWarningHandling(TOptional<bool> LogErrorsAreErrors, TOptional<bool> LogWarningsAreErrors)
{
SetLogErrorAndWarningHandlingToDefault();
}
/**
* Determines if Error logs should be considered test errors
*/
virtual bool TreatLogErrorsAsErrors() override
{
return bTreatLogErrorsAsErrors;
}
/**
* Determines if Warning logs should be considered test errors
*/
virtual bool TreatLogWarningsAsErrors() override
{
return bTreatLogWarningsAsErrors;
}
/**
* Returns true if a functional test is running (does not include map setup)
*/
bool IsFunctionalTestRunning()
{
return bIsFunctionalTestRunning;
}
/**
* Marks us as actively running a functional test
*/
void SetFunctionalTestRunning(bool bIsRunning)
{
bIsFunctionalTestRunning = bIsRunning;
}
protected:
void SetLogErrorAndWarningHandlingToDefault();
bool bTreatLogErrorsAsErrors;
bool bTreatLogWarningsAsErrors;
bool bSuppressLogs;
bool bIsFunctionalTestRunning;
};