Files
UnrealEngineUWP/Engine/Source/Developer/FunctionalTesting/Classes/ScreenshotFunctionalTest.h
christopher fiala d1fd4e1e08 [Reintegration] - CL30342517
[FYI] christopher.fiala
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL30314361
[FYI] christopher.fiala
Original CL Desc
-----------------------------------------------------------------
Overhaul stereo variants to support an arbitrary number of variants and correctly implement per-variant frame delays and test preparation, significantly reducing false failures.
Fixes compatibility with TSR sequence screenshot functional test blueprints.

#jira UE-194361
#rb sean.sweeney

[CL 30352401 by christopher fiala in ue5-main branch]
2023-12-15 12:41:53 -05:00

73 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "ScreenshotFunctionalTestBase.h"
#include "AutomationScreenshotOptions.h"
#include "ScreenshotFunctionalTest.generated.h"
class FAutomationTestScreenshotEnvSetup;
/**
* No UI
*/
UCLASS(Blueprintable)
class FUNCTIONALTESTING_API AScreenshotFunctionalTest : public AScreenshotFunctionalTestBase
{
GENERATED_BODY()
public:
AScreenshotFunctionalTest(const FObjectInitializer& ObjectInitializer);
virtual void Serialize(FArchive& Ar) override;
// Tests not relying on temporal effects can force a camera cut to flush stale data
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera", SimpleDisplay)
bool bCameraCutOnScreenshotPrep;
protected:
virtual bool RunTest(const TArray<FString>& Params = TArray<FString>()) override;
virtual void PrepareTest() override;
virtual bool IsReady_Implementation() override;
virtual void Tick(float DeltaSeconds) override;
virtual void RequestScreenshot() override;
virtual void OnScreenShotCaptured(int32 InSizeX, int32 InSizeY, const TArray<FColor>& InImageData) override;
virtual void OnScreenshotTakenAndCompared() override;
private:
enum EVariantType
{
Baseline = 0,
ViewRectOffset,
Num
};
struct FVariantInfo
{
const TCHAR* Name;
const TCHAR* SetupCommand;
const TCHAR* RestoreCommand;
};
bool SetupNextVariant();
void SetupVariant(EVariantType VariantType);
TBitArray<> RequestedVariants;
const TCHAR* CurrentVariantName;
const TCHAR* VariantRestoreCommand;
// Used for subsequent variants after the first is done
void ReprepareTest();
uint32 VariantFrame;
float VariantTime;
bool bVariantQueued;
};