Files
UnrealEngineUWP/Engine/Source/Developer/FunctionalTesting/Classes/FunctionalTestingManager.h
Mieszko Zielinski 1895e026a2 Added a way to trigger specific subset of functional tests #UE4
When a whole set of functional tests is run as part of summary a "Repro String" is generated. This string can be used as a parameter to RunAllFunctionalTests and if so only indicated tests will be performed.

[CL 2108028 by Mieszko Zielinski in Main branch]
2014-06-17 08:31:02 -04:00

80 lines
2.5 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Misc/AutomationTest.h"
#include "FunctionalTestingManager.generated.h"
namespace FFunctionalTesting
{
extern const TCHAR* ReproStringTestSeparator;
extern const TCHAR* ReproStringParamsSeparator;
}
UCLASS(BlueprintType, MinimalAPI)
class UFunctionalTestingManager : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
UPROPERTY(Transient)
TArray<class AFunctionalTest*> TestsLeft;
UPROPERTY(Transient)
TArray<class AFunctionalTest*> AllTests;
UPROPERTY(BlueprintAssignable)
FFunctionalTestEventSignature OnSetupTests;
UFUNCTION(BlueprintCallable, Category="FunctionalTesting", meta=(HidePin="WorldContext", DefaultToSelf="WorldContext" ) )
/** Triggers in sequence all functional tests found on the level.
* @return true if any tests have been triggered */
static bool RunAllFunctionalTests(UObject* WorldContext, bool bNewLog = true, bool bRunLooped = false, bool bWaitForNavigationBuildFinish = true, FString FailedTestsReproString = TEXT(""));
bool IsRunning() const { return bIsRunning; }
bool IsLooped() const { return bLooped; }
void SetLooped(const bool bNewLooped) { bLooped = bNewLooped; }
void TickMe(float DeltaTime);
//----------------------------------------------------------------------//
// Automation logging
//----------------------------------------------------------------------//
static void SetAutomationExecutionInfo(FAutomationTestExecutionInfo* InExecutionInfo) { ExecutionInfo = InExecutionInfo; }
static void AddError(const FText& InError);
static void AddWarning(const FText& InWarning);
static void AddLogItem(const FText& InLogItem);
private:
void LogMessage(const FString& MessageString, TSharedPtr<IMessageLogListing> LogListing = NULL);
protected:
static UFunctionalTestingManager* GetManager(UObject* WorldContext);
void TriggerFirstValidTest();
void SetUpTests();
void OnTestDone(class AFunctionalTest* FTest);
void OnEndPIE(const bool bIsSimulating);
bool RunFirstValidTest();
void NotifyTestDone(class AFunctionalTest* FTest);
void SetReproString(FString ReproString);
void AllTestsDone();
bool bIsRunning;
bool bLooped;
bool bWaitForNavigationBuildFinish;
bool bInitialDelayApplied;
uint32 CurrentIteration;
FFunctionalTestDoneSignature TestFinishedObserver;
FString GatheredFailedTestsReproString;
FString StartingReproString;
TArray<FString> TestReproStrings;
static FAutomationTestExecutionInfo* ExecutionInfo;
};