MaterialEditorPromotionTest

MaterialEditorPromotionTest

#Overview

name: MaterialEditorPromotionTest

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of MaterialEditorPromotionTest is to provide settings for automated tests related to the Material Editor in Unreal Engine 5. This variable is part of the automation testing framework, specifically for promoting and validating the functionality of the Material Editor.

This setting variable is primarily used by the Editor Tests module and the Material Editor module. It’s referenced in the EditorBuildPromotionTests and MaterialEditorTests files, indicating its importance in validating the Material Editor’s functionality.

The value of this variable is set in the UAutomationTestSettings class, which is likely configured through the project settings or an configuration file. It’s defined as an UPROPERTY with the EditAnywhere and config specifiers, allowing it to be edited in the Unreal Editor and saved to configuration files.

MaterialEditorPromotionTest interacts with other test-related variables, such as ParticleEditorPromotionTest, as they are part of the same UAutomationTestSettings class. It also interacts with the DefaultMaterialAsset property, which is used to specify the default material for testing.

Developers should be aware that this variable is crucial for automated testing of the Material Editor. Modifying its values could affect the outcome of these tests, potentially leading to false positives or negatives in the automation process.

Best practices when using this variable include:

  1. Ensuring that the DefaultMaterialAsset is properly set to a valid material for consistent test results.
  2. Regularly reviewing and updating the test settings to reflect any changes in the Material Editor’s functionality.
  3. Using this variable in conjunction with other automation tools to create comprehensive test suites for the Material Editor.
  4. Documenting any changes made to these settings to maintain transparency in the testing process.
  5. Collaborating with the QA team to ensure that the promotion tests cover all critical aspects of the Material Editor’s functionality.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:2780, section: [/Script/Engine.AutomationTestSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/EditorBuildPromotionTests.cpp:1791

Scope (from outer to inner):

file
namespace    BuildPromotionTestHelper
function     bool ContentBrowser_AssignAMaterial

Source code excerpt:


			// Load default material asset
			FString MaterialPackagePath = AutomationTestSettings->MaterialEditorPromotionTest.DefaultMaterialAsset.FilePath;
			if (!(MaterialPackagePath.Len() > 0))
			{
				UE_LOG(LogEditorBuildPromotionTests, Warning, TEXT("Skipping material assignment test: no default material defined."));
				return true;
			}

#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/Tests/MaterialEditorTests.cpp:39

Scope (from outer to inner):

file
namespace    MaterialEditorPromotionTestUtils
function     static FMaterialEditorPromotionSettings TestSettings

Source code excerpt:

		check(AutomationTestSettings);

		return AutomationTestSettings->MaterialEditorPromotionTest;
	}


	/**
	* Assigns a normal map to a material
	*

#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/Tests/MaterialEditorTests.cpp:235

Scope (from outer to inner):

file
function     bool FRunMaterialEditorPromotionTestCommand::Update

Source code excerpt:

bool FRunMaterialEditorPromotionTestCommand::Update()
{
	return MaterialEditorPromotionTest->Update();
}


/**
* Automation test that handles the build promotion process
*/

#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/Tests/MaterialEditorTests.cpp:246

Scope (from outer to inner):

file
function     bool FMaterialEditorPromotionTest::RunTest

Source code excerpt:

bool FMaterialEditorPromotionTest::RunTest(const FString& Parameters)
{
	TSharedPtr<MaterialEditorPromotionTestHelper::FMaterialEditorPromotionTest> MaterialEditorPromotionTest = MakeShareable(new MaterialEditorPromotionTestHelper::FMaterialEditorPromotionTest(&ExecutionInfo));
	ADD_LATENT_AUTOMATION_COMMAND(FRunMaterialEditorPromotionTestCommand(MaterialEditorPromotionTest));
	return true;
}

#undef LOCTEXT_NAMESPACE

#endif //WITH_DEV_AUTOMATION_TESTS

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Tests/AutomationTestSettings.h:395

Scope (from outer to inner):

file
class        class UAutomationTestSettings : public UObject

Source code excerpt:

	*/
	UPROPERTY(EditAnywhere, config, Category = Automation)
	FMaterialEditorPromotionSettings MaterialEditorPromotionTest;

	/**
	* Particle editor promotion test settings
	*/
	UPROPERTY(EditAnywhere, config, Category = Automation)
	FParticleEditorPromotionSettings ParticleEditorPromotionTest;