Files
UnrealEngineUWP/Engine/Source/Programs/ReplicationSystemTest/Private/AutomationTestRunner.cpp
Peter Engstrom 4aae8d3ed0 Iris experimental replication system.
Initial submit, compiled out by default.

#rb Peter.Engstrom,Mattias.Hornlund,Brian.Bekich,Ryan.Gerleve,John.Barrett
#jira UE-158381
#preflight /62cd6fc7ad490b52da0515a3

[CL 21068370 by Peter Engstrom in ue5-main branch]
2022-07-13 03:11:55 -04:00

61 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "AutomationTestRunner.h"
#include "ReplicationSystemTestPlugin/NetworkAutomationTest.h"
#if WITH_AUTOMATION_WORKER
namespace UE::Net
{
FAutomationTestRunner::FAutomationTestRunner()
{
}
void
FAutomationTestRunner::RunTests()
{
constexpr int32 ExpectedTestCount = 2048;
TArray<FAutomationTestInfo> TestInfos;
TestInfos.Empty(ExpectedTestCount);
FAutomationTestFramework& TestFramework = FAutomationTestFramework::Get();
TestFramework.SetRequestedTestFilter(EAutomationTestFlags::SmokeFilter | EAutomationTestFlags::EngineFilter);
TestFramework.GetValidTestNames(TestInfos);
int TestCount = TestInfos.Num();
if (TestCount <= 0)
return;
// Stack walking doesn't work properly on Windows when omitting frame pointers. See WindowsPlatformStackWalk.cpp.
const bool bCaptureStack = TestFramework.GetCaptureStack();
TestFramework.SetCaptureStack(false);
const FString TestPrefix("Net.");
const double TestStartTime = FPlatformTime::Seconds();
for (int TestIt = 0; TestIt != TestCount; ++TestIt)
{
const FAutomationTestInfo& TestInfo = TestInfos[TestIt];
const FString& TestCommand = TestInfo.GetTestName();
if (!TestCommand.StartsWith(TestPrefix) && !TestInfo.GetDisplayName().StartsWith(TestPrefix))
continue;
constexpr int32 RoleIndex = 0;
TestFramework.StartTestByName(TestCommand, RoleIndex);
}
const double TestEndTime = FPlatformTime::Seconds();
const double TestTime = TestEndTime - TestStartTime;
UE_LOG(LogNetworkAutomationTest, Display, TEXT("Tests took %.3lf seconds to execute"), TestTime);
FAutomationTestExecutionInfo ExecutionInfo;
TestFramework.StopTest(ExecutionInfo);
TestFramework.SetCaptureStack(bCaptureStack);
PrintNetworkAutomationTestSummary();
}
}
#endif