bForceSmokeTests

bForceSmokeTests

#Overview

name: bForceSmokeTests

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 bForceSmokeTests is to control the execution of smoke tests in the Unreal Engine’s automation testing framework. Smoke tests are typically quick, high-level tests that verify the basic functionality of a system.

This setting variable is primarily used in the Unreal Engine’s core automation testing system. It is referenced in the FAutomationTestFramework class, which is part of the engine’s core module.

The value of this variable is set in multiple ways:

  1. It is initialized to false in the FAutomationTestFramework constructor.
  2. It can be set through the SetForceSmokeTests function of FAutomationTestFramework.
  3. Its value is determined in the AppInit function of FEngineLoop, where it’s read from the GEngineIni configuration file and can also be set via command-line parameter.

The bForceSmokeTests variable interacts with other conditions in the RunSmokeTests function to determine whether smoke tests should be executed. It can override other conditions that would normally prevent smoke tests from running.

Developers must be aware that setting this variable to true will force smoke tests to run, even in situations where they might not normally execute. This can be useful for debugging or ensuring that basic functionality is working, but it may also impact performance or interfere with other processes if used inappropriately.

Best practices when using this variable include:

  1. Use it judiciously, as forcing smoke tests may impact performance or interfere with normal operation.
  2. Consider setting it via configuration files or command-line parameters for flexibility.
  3. Be aware of its impact on the automation testing process and use it in conjunction with other testing strategies.
  4. Document any changes to this setting to ensure other team members are aware of its state.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:2761, section: [AutomationTesting]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/AutomationTest.cpp:413

Scope (from outer to inner):

file
function     bool FAutomationTestFramework::RunSmokeTests

Source code excerpt:

	// Ensure there isn't another slow task in progress when trying to run unit tests
	const bool bRequiresCookedData = FPlatformProperties::RequiresCookedData();
	if ((!bRequiresCookedData && !GIsSlowTask && !GIsPlayInEditorWorld && !FPlatformProperties::IsProgram() && !IsRunningCommandlet()) || bForceSmokeTests)
	{
		TArray<FAutomationTestInfo> TestInfo;

		GetValidTestNames( TestInfo );

		if ( TestInfo.Num() > 0 )

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/AutomationTest.cpp:1134

Scope (from outer to inner):

file
function     FAutomationTestFramework::FAutomationTestFramework

Source code excerpt:

	, bDeveloperDirectoryIncluded(false)
	, NetworkRoleIndex(0)
	, bForceSmokeTests(false)
	, bCaptureStack(true)
{
}

FAutomationTestFramework::~FAutomationTestFramework()
{

#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/AutomationTest.h:1117

Scope (from outer to inner):

file
class        class FAutomationTestFramework
function     void SetForceSmokeTests

Source code excerpt:

	void SetForceSmokeTests(const bool bInForceSmokeTests)
	{
		bForceSmokeTests = bInForceSmokeTests;
	}

	bool GetCaptureStack() const
	{
		return bCaptureStack && !NeedSkipStackWalk();
	}

#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/AutomationTest.h:1404

Scope (from outer to inner):

file
class        class FAutomationTestFramework

Source code excerpt:


	/** Forces running smoke tests */
	bool bForceSmokeTests;

	bool bCaptureStack;

	TMap<FString, FOnTestSectionEvent> OnEnteringTestSectionEvent;
	TMap<FString, FOnTestSectionEvent> OnLeavingTestSectionEvent;
};

#Loc: <Workspace>/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp:6832

Scope (from outer to inner):

file
function     bool FEngineLoop::AppInit

Source code excerpt:

	GColorList.CreateColorMap();

	bool bForceSmokeTests = false;
	GConfig->GetBool(TEXT("AutomationTesting"), TEXT("bForceSmokeTests"), bForceSmokeTests, GEngineIni);
	bForceSmokeTests |= FParse::Param(FCommandLine::Get(), TEXT("bForceSmokeTests"));
	FAutomationTestFramework::Get().SetForceSmokeTests(bForceSmokeTests);

	FEmbeddedCommunication::ForceTick(18);

	// Init other systems.
	{
		SCOPED_BOOT_TIMING("FCoreDelegates::OnInit.Broadcast");