![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <AutomationTest.h>
Static Public Member Functions | |
| static CORE_API FAutomationTestFramework & | Get () |
| static FAutomationTestFramework & | GetInstance () |
| static CORE_API bool | NeedSkipStackWalk () |
| static CORE_API bool | NeedLogBPTestMetadata () |
| static CORE_API bool | NeedPerformStereoTestVariants () |
| static CORE_API bool | NeedUseLightweightStereoTestVariants () |
Friends | |
| class | FAutomationTestOutputDevice |
Class representing the main framework for running automation tests
| void FAutomationTestFramework::AddAnalyticsItemToCurrentTest | ( | const FString & | AnalyticsItem | ) |
Adds a analytics string to the current test to be parsed later. Must be called only when an automation test is in progress
| AnalyticsItem | Log item to add to the current test |
| bool FAutomationTestFramework::CanRunTestInEnvironment | ( | const FString & | InTestToRun, |
| FString * | OutReason, | ||
| bool * | OutWarn | ||
| ) | const |
Internal helper method designed to check if the given test is able to run in the current environment.
| InTestToRun | test name |
| OutReason | the related reason of the skipping |
| OutWarn | the related warning of the skipping |
| bool FAutomationTestFramework::ContainsTest | ( | const FString & | InTestName | ) | const |
Checks if a provided test is contained within the framework.
| InTestName | Name of the test to check |
| void FAutomationTestFramework::DequeueAllCommands | ( | ) |
Dequeue all latent and network commands
| void FAutomationTestFramework::EnqueueLatentCommand | ( | TSharedPtr< IAutomationLatentCommand > | NewCommand | ) |
Enqueues a latent command for execution on a subsequent frame
| NewCommand | - The new command to enqueue for deferred execution |
| void FAutomationTestFramework::EnqueueNetworkCommand | ( | TSharedPtr< IAutomationNetworkCommand > | NewCommand | ) |
Enqueues a network command for execution in accordance with this workers role
| NewCommand | - The new command to enqueue for network execution |
| bool FAutomationTestFramework::ExecuteLatentCommands | ( | ) |
Execute all latent functions that complete during update
| bool FAutomationTestFramework::ExecuteNetworkCommands | ( | ) |
Execute the next network command if you match the role, otherwise just dequeue
|
static |
Return the singleton instance of the framework.
| TSet< FString > FAutomationTestFramework::GetAllExistingTags | ( | ) |
|
inline |
|
inline |
Returns the actively executing test or null if there isn't one
|
inline |
Returns the actively executing test full path
|
inlinestatic |
| FOnTestSectionEvent & FAutomationTestFramework::GetOnEnteringTestSection | ( | const FString & | Section | ) |
Called entering test section.
| FOnTestSectionEvent & FAutomationTestFramework::GetOnLeavingTestSection | ( | const FString & | Section | ) |
Called leaving test section.
| void FAutomationTestFramework::GetPossibleRestrictedPaths | ( | const FString & | BasePath, |
| const TArray< FString > & | RestrictedFolderNames, | ||
| TArray< FString > & | OutRestrictedFolders | ||
| ) | const |
| FString FAutomationTestFramework::GetTagsForAutomationTest | ( | const FString & | InTestName | ) |
Fetch the tags associated with a test
| InTestName | Name of the test to find tags for |
| TArray< FString > FAutomationTestFramework::GetTagsForAutomationTestAsArray | ( | const FString & | InTestName | ) |
Fetch the tags associated with a test as an array of strings
| InTestName | Name of the test to find tags for |
| void FAutomationTestFramework::GetTestFullNamesMatchingTagPattern | ( | TArray< FString > & | OutTestNames, |
| const FString & | TagPattern | ||
| ) | const |
Collects all registered tests with associated tags matching the pattern
| OutTestNames | Array that will be modified to contain only the set of matching tests |
| TagPattern | An "Advanced Search Syntax" query to select matching tags from the registered tests |
| FString FAutomationTestFramework::GetUserAutomationDirectory | ( | ) | const |
Gets a scratch space location outside of the project and saved directories. When an automation test needs to do something like generate project files, or create new projects it should use this directory, rather than pollute other areas of the machine.
| void FAutomationTestFramework::GetValidTestNames | ( | TArray< FAutomationTestInfo > & | TestInfo | ) | const |
Populates the provided array with the names of all tests in the framework that are valid to run for the current application settings.
| TestInfo | Array to populate with the test information |
| bool FAutomationTestFramework::IsAnyOnEnteringTestSectionBound | ( | ) | const |
| bool FAutomationTestFramework::IsAnyOnLeavingTestSectionBound | ( | ) | const |
|
inline |
Whether there is no latent command in queue
| bool FAutomationTestFramework::IsTagImmutable | ( | const FString & | InTestName, |
| const FString & | InTag | ||
| ) | const |
| void FAutomationTestFramework::LoadTestModules | ( | ) |
Load any modules that are not loaded by default and have test classes in them
| void FAutomationTestFramework::LoadTestTagMappings | ( | ) |
Reads test tag mappings from all Tags.ini config files
| void FAutomationTestFramework::LoadTestTagMappings | ( | const FString & | BasePath, |
| const bool | RestrictedPathsOnly | ||
| ) |
Reads test tag mappings under a certain base path
|
static |
Whether to output blueprint functional test metadata to the log when test is running
|
static |
Whether to also run stereo test variants for screenshot functional tests
|
static |
Whether to skip stack walk while iterating for listing the tests
|
static |
Whether to skip variants when the baseline test fails, and skip saving screenshots for successful variants
| void FAutomationTestFramework::NotifyPerformanceDataRetrieved | ( | bool | bSuccess, |
| const FString & | ErrorMessage | ||
| ) |
| void FAutomationTestFramework::NotifyScreenshotComparisonComplete | ( | const FAutomationScreenshotCompareResults & | CompareResults | ) |
Notify that the screenshot comparison has completed
| void FAutomationTestFramework::NotifyScreenshotComparisonReport | ( | const FAutomationScreenshotCompareResults & | CompareResults | ) |
Notify the screenshot comparison report to the framework
| void FAutomationTestFramework::NotifyScreenshotTakenAndCompared | ( | ) |
| FOnTestScreenshotAndTraceCaptured & FAutomationTestFramework::OnScreenshotAndTraceCaptured | ( | ) |
Accessor for delegate called when a png screenshot is captured and a frame trace
| FOnTestScreenshotCaptured & FAutomationTestFramework::OnScreenshotCaptured | ( | ) |
Accessor for delegate called when a png screenshot is captured
| bool FAutomationTestFramework::RegisterAutomationTest | ( | const FString & | InTestNameToRegister, |
| FAutomationTestBase * | InTestToRegister | ||
| ) |
Register a automation test into the framework. The automation test may or may not be necessarily valid for the particular application configuration, but that will be determined when tests are attempted to be run.
| InTestNameToRegister | Name of the test being registered |
| InTestToRegister | Actual test to register |
| bool FAutomationTestFramework::RegisterAutomationTestTags | ( | const FString & | InTestNameToRegister, |
| const FString & | InTestTagsToRegister, | ||
| bool | InImmutable = true |
||
| ) |
Register tag metadata for a test into the framework.
| InTestNameToRegister | FullName of the test to associate with tags |
| InTestTagsToRegister | Concatenated string of tags to register |
| InImmutable | Whether tags are immutable. If false, merge with existing tags, keeping the immutable |
| bool FAutomationTestFramework::RegisterComplexAutomationTestTags | ( | const FAutomationTestBase * | InTest, |
| const FString & | InBeautifiedTestName, | ||
| const FString & | InTestTagsToRegister | ||
| ) |
Helper to register tags for a individual test enumerated by a Complex test
| InTest | The Complex test to associate with |
| InBeautifiedTestName | The name of the individual test |
| InTestTagsToRegister | Concatenated string of tags to register |
| void FAutomationTestFramework::ResetTests | ( | ) |
Reset status of worker (delete local files, etc)
| bool FAutomationTestFramework::RunSmokeTests | ( | ) |
Attempt to run all fast smoke tests that are valid for the current application configuration.
| void FAutomationTestFramework::SaveTestTagMappings | ( | const TArray< FString > & | TestFullNames, |
| const TArray< FString > & | TestFilePaths, | ||
| const FBeforeTagMappingConfigSaved & | BeforeConfigSaved, | ||
| const FAfterTagMappingConfigSaved & | AfterConfigSaved | ||
| ) | const |
Saves test tag mappings optionally invoking before / after events.
Used to disabled stack capture when an error or warning event is triggered. Setting bCapture=true does not guarantees GetCaptureStack()=true because that method also depend on NeedSkipStackWalk().
| void FAutomationTestFramework::SetDeveloperDirectoryIncluded | ( | const bool | bInDeveloperDirectoryIncluded | ) |
Sets whether we want to include content in developer directories in automation testing
Sets forcing smoke tests.
| void FAutomationTestFramework::SetRequestedTestFilter | ( | const EAutomationTestFlags | InRequestedTestFlags | ) |
Sets which set of tests to pull from.
| bool FAutomationTestFramework::ShouldTestContent | ( | const FString & | Path | ) | const |
Whether the testing framework should allow content to be tested or not. Intended to block developer directories.
| Path | - Full path to the content in question |
| void FAutomationTestFramework::StartTestByName | ( | const FString & | InTestToRun, |
| const int32 | InRoleIndex, | ||
| const FString & | InFullTestPath = FString() |
||
| ) |
Attempt to start the specified test.
| InTestToRun | Name of the test that should be run |
| InRoleIndex | Identifier for which worker in this group that should execute a command |
| InFullTestPath | Full test path |
| bool FAutomationTestFramework::StopTest | ( | FAutomationTestExecutionInfo & | OutExecutionInfo | ) |
Stop the current test and return the results of execution
| void FAutomationTestFramework::TriggerOnEnteringTestSection | ( | const FString & | Section | ) | const |
| void FAutomationTestFramework::TriggerOnLeavingTestSection | ( | const FString & | Section | ) | const |
| bool FAutomationTestFramework::UnregisterAutomationTest | ( | const FString & | InTestNameToUnregister | ) |
Unregister a automation test with the provided name from the framework.
| bool FAutomationTestFramework::UnregisterAutomationTestTags | ( | const FString & | InTestNameToUnregister | ) |
Unregister tags for a automation test from the framework.
| InTestNameToUnregister | FullName of the test to remove tags from |
|
friend |
| FSimpleMulticastDelegate FAutomationTestFramework::OnAfterAllTestsEvent |
Called after all chosen tests run have finished.
| FSimpleMulticastDelegate FAutomationTestFramework::OnBeforeAllTestsEvent |
Called before all chosen tests run.
| FOnPerformanceDataRetrieved FAutomationTestFramework::OnPerformanceDataRetrieved |
Called when the performance data is retrieved.
| FOnTestScreenshotComparisonComplete FAutomationTestFramework::OnScreenshotCompared |
Called when a screenshot comparison completes.
| FOnTestScreenshotComparisonReport FAutomationTestFramework::OnScreenshotComparisonReport |
Called when a screenshot comparison result is reported
| FSimpleMulticastDelegate FAutomationTestFramework::OnScreenshotTakenAndCompared |
The final call related to screenshots, after they've been taken, and after they've been compared (or not if automation isn't running).
| FOnTestDataRetrieved FAutomationTestFramework::OnTestDataRetrieved |
Called when the test data is retrieved.
| FOnTestEvent FAutomationTestFramework::OnTestEndEvent |
Called when each automated test is ending
| FOnTestEvent FAutomationTestFramework::OnTestStartEvent |
Called when each automated test is starting
| FSimpleMulticastDelegate FAutomationTestFramework::PostTestingEvent |
Called after all automated tests have completed
| FSimpleMulticastDelegate FAutomationTestFramework::PreTestingEvent |
Called right before automated test is about to begin