Merge pull request #1152 from aws-lumberyard-dev/SpawnableDespawnAllEntitiesUnitTestFix
Disabled writing UserSettings.xml in Spawnable tests.
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AzCore/UnitTest/TestTypes.h>
|
#include <AzCore/UnitTest/TestTypes.h>
|
||||||
|
#include <AzCore/UserSettings/UserSettingsComponent.h>
|
||||||
#include <AzFramework/Application/Application.h>
|
#include <AzFramework/Application/Application.h>
|
||||||
#include <AzFramework/Spawnable/SpawnableAssetHandler.h>
|
#include <AzFramework/Spawnable/SpawnableAssetHandler.h>
|
||||||
#include <AzFramework/Spawnable/SpawnableEntitiesManager.h>
|
#include <AzFramework/Spawnable/SpawnableEntitiesManager.h>
|
||||||
@@ -40,6 +41,10 @@ namespace UnitTest
|
|||||||
m_application = new TestApplication();
|
m_application = new TestApplication();
|
||||||
AZ::ComponentApplication::Descriptor descriptor;
|
AZ::ComponentApplication::Descriptor descriptor;
|
||||||
m_application->Start(descriptor);
|
m_application->Start(descriptor);
|
||||||
|
// Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
|
||||||
|
// shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
|
||||||
|
// in the unit tests.
|
||||||
|
AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
|
||||||
|
|
||||||
m_spawnable = aznew AzFramework::Spawnable(
|
m_spawnable = aznew AzFramework::Spawnable(
|
||||||
AZ::Data::AssetId::CreateString("{EB2E8A2B-F253-4A90-BBF4-55F2EED786B8}:0"), AZ::Data::AssetData::AssetStatus::Ready);
|
AZ::Data::AssetId::CreateString("{EB2E8A2B-F253-4A90-BBF4-55F2EED786B8}:0"), AZ::Data::AssetData::AssetStatus::Ready);
|
||||||
|
|||||||
Reference in New Issue
Block a user