Setting project path to AutomatedTesting to fix the EMotionFX CanUseFileMenu and CanOpenWorkspace test from failing when resolving a relative path

This commit is contained in:
lumberyard-employee-dm
2021-05-25 22:53:56 -05:00
parent 4b75b7bb63
commit 58bd72c429
2 changed files with 10 additions and 2 deletions
@@ -59,7 +59,16 @@ namespace EMotionFX
{
public:
ComponentFixtureApp() = default;
ComponentFixtureApp()
{
using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
constexpr auto projectPathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path";
if(auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
settingsRegistry->Set(projectPathKey, "AutomatedTesting");
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry);
}
}
AZ::ComponentTypeList GetRequiredSystemComponents() const override
{
@@ -77,7 +77,6 @@ namespace EMotionFX
{
auto testAssetsPath = AZ::IO::Path(GetEMotionFX().GetAssetCacheFolder()) / "TmpTestAssets";
QString dataDir = QString::fromUtf8(testAssetsPath.c_str(), aznumeric_cast<int>(testAssetsPath.Native().size()));
dataDir += "TmpTestAssets";
if (!QDir(dataDir).exists())
{