You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Introduce bElevateLogWarningsToErrors as a good name for existing functionality. Note it's assuming the name as it's known by its customer code. This change lines up the settings variable to its colloquial name around the codebase. Deprecate bTreatLogWarningsAsTestErrors as it was misleading because it doesn't really shuffle log warnings into the test errors bucket as much as it just reclassifies the log verbosity from log warning to log error. Remove bTreatLogErrorsAsTestErrors as it wasn't functional outside of EditorIterationTest's custom base class, and it's tempting to use incorrectly in place of bSuppressLogErrors #rnx #jira none #rb andrew.grant #preflight 6142442c4778fa000135b987 [CL 17526549 by geoff evans in ue5-main branch]
70 lines
1.9 KiB
C++
70 lines
1.9 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "FunctionalTestBase.h"
|
|
#include "FunctionalTestingModule.h"
|
|
#include "AutomationControllerSettings.h"
|
|
|
|
|
|
// statics
|
|
bool FFunctionalTestBase::bIsFunctionalTestRunning;
|
|
FString FFunctionalTestBase::ActiveTestName;
|
|
|
|
|
|
FFunctionalTestBase::FFunctionalTestBase(const FString& InName, const bool bInComplexTask)
|
|
: FAutomationTestBase(InName, bInComplexTask)
|
|
{
|
|
bSuppressLogs = false;
|
|
bIsFunctionalTestRunning = false;
|
|
// CDO not available at this point
|
|
bSuppressLogErrors = false;
|
|
bSuppressLogWarnings = false;
|
|
bElevateLogWarningsToErrors = true;
|
|
}
|
|
|
|
void FFunctionalTestBase::SetLogErrorAndWarningHandlingToDefault()
|
|
{
|
|
// Set to project defaults
|
|
UAutomationControllerSettings* Settings = UAutomationControllerSettings::StaticClass()->GetDefaultObject<UAutomationControllerSettings>();
|
|
bSuppressLogErrors = Settings->bSuppressLogErrors;
|
|
bSuppressLogWarnings = Settings->bSuppressLogWarnings;
|
|
bElevateLogWarningsToErrors = Settings->bElevateLogWarningsToErrors;
|
|
}
|
|
|
|
/**
|
|
* Marks us as actively running a functional test
|
|
*/
|
|
void FFunctionalTestBase::SetFunctionalTestRunning(const FString& InName)
|
|
{
|
|
if (bIsFunctionalTestRunning)
|
|
{
|
|
UE_LOG(LogFunctionalTest, Error, TEXT("A Functional test is already running!"));
|
|
}
|
|
|
|
if (InName.Len() == 0)
|
|
{
|
|
UE_LOG(LogFunctionalTest, Error, TEXT("No test name supplied!"));
|
|
}
|
|
|
|
bIsFunctionalTestRunning = true;
|
|
ActiveTestName = InName;
|
|
}
|
|
|
|
/**
|
|
* Marks us as no longer running a test
|
|
*/
|
|
void FFunctionalTestBase::SetFunctionalTestComplete(const FString& InName)
|
|
{
|
|
if (!bIsFunctionalTestRunning)
|
|
{
|
|
UE_LOG(LogFunctionalTest, Error, TEXT("SetFunctionalComplete() called with no active test"));
|
|
}
|
|
|
|
if (InName != ActiveTestName)
|
|
{
|
|
UE_LOG(LogFunctionalTest, Error, TEXT("SetFunctionalComplete: Complete name %s did not match active name %s"), *InName, *ActiveTestName);
|
|
}
|
|
|
|
bIsFunctionalTestRunning = false;
|
|
ActiveTestName = TEXT("");
|
|
}
|