From fda8475d6b3e26f9cf02866206fb7eaa31d1107c Mon Sep 17 00:00:00 2001 From: npruehs Date: Wed, 8 Jul 2020 16:02:51 +0200 Subject: [PATCH] Add flag the specifies whether to include performance tests in default reports. --- .../Private/DaeTestPerformanceBudgetActor.cpp | 11 ++++++++++- .../Public/DaeTestPerformanceBudgetActor.h | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Private/DaeTestPerformanceBudgetActor.cpp b/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Private/DaeTestPerformanceBudgetActor.cpp index 3eded48..b983b48 100644 --- a/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Private/DaeTestPerformanceBudgetActor.cpp +++ b/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Private/DaeTestPerformanceBudgetActor.cpp @@ -41,6 +41,8 @@ ADaeTestPerformanceBudgetActor::ADaeTestPerformanceBudgetActor( GameThreadBudget = 20.0f; RenderThreadBudget = 20.0f; GPUBudget = 20.0f; + + bIncludeInDefaultTestReport = true; } void ADaeTestPerformanceBudgetActor::BeginPlay() @@ -266,7 +268,14 @@ TSharedPtr ADaeTestPerformanceBudgetActor::CollectResults() FDaeTestReportWriterSet ADaeTestPerformanceBudgetActor::GetReportWriters() const { - FDaeTestReportWriterSet ReportWriters = Super::GetReportWriters(); + FDaeTestReportWriterSet ReportWriters; + + if (bIncludeInDefaultTestReport) + { + FDaeTestReportWriterSet DefaultReportWriters = Super::GetReportWriters(); + ReportWriters.Add(DefaultReportWriters); + } + ReportWriters.Add(MakeShareable(new FDaeTestReportWriterPerformance())); return ReportWriters; } diff --git a/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Public/DaeTestPerformanceBudgetActor.h b/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Public/DaeTestPerformanceBudgetActor.h index 578f715..e950bf7 100644 --- a/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Public/DaeTestPerformanceBudgetActor.h +++ b/DaedalicTestAutomationPlugin/Source/DaedalicTestAutomationPlugin/Public/DaeTestPerformanceBudgetActor.h @@ -67,6 +67,10 @@ class DAEDALICTESTAUTOMATIONPLUGIN_API ADaeTestPerformanceBudgetActor : public A UPROPERTY(EditAnywhere) float GPUBudget; + /** Whether performance budget violations should cause a failure item in default test reports. */ + UPROPERTY(EditAnywhere) + bool bIncludeInDefaultTestReport; + bool bIsRunning; bool bIsRecording;