Integrating up through commit 90f050496
This commit is contained in:
+20
-3
@@ -34,7 +34,7 @@
|
||||
#include <AzToolsFramework/ViewportSelection/EditorDefaultSelection.h>
|
||||
#include <AzToolsFramework/ViewportSelection/EditorInteractionSystemViewportSelectionRequestBus.h>
|
||||
#include <AzToolsFramework/SourceControl/PerforceConnection.h>
|
||||
|
||||
#include <AzToolsFramework/UnitTest/ToolsTestApplication.h>
|
||||
|
||||
#include <ostream>
|
||||
|
||||
@@ -42,6 +42,21 @@ AZ_PUSH_DISABLE_WARNING(4127, "-Wunknown-warning-option") // warning suppressed:
|
||||
#include <QtTest/QtTest>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
#define AUTO_RESULT_IF_SETTING_TRUE(_settingName, _result) \
|
||||
{ \
|
||||
bool settingValue = true; \
|
||||
if (auto* registry = AZ::SettingsRegistry::Get()) \
|
||||
{ \
|
||||
registry->Get(settingValue, _settingName); \
|
||||
} \
|
||||
\
|
||||
if (settingValue) \
|
||||
{ \
|
||||
EXPECT_TRUE(_result); \
|
||||
return; \
|
||||
} \
|
||||
}
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
class Entity;
|
||||
@@ -51,6 +66,8 @@ namespace AZ
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
constexpr AZStd::string_view prefabSystemSetting = "/Amazon/Preferences/EnablePrefabSystem";
|
||||
|
||||
/// Test widget to store QActions generated by EditorTransformComponentSelection.
|
||||
class TestWidget
|
||||
: public QWidget
|
||||
@@ -122,7 +139,7 @@ namespace UnitTest
|
||||
if (!GetApplication())
|
||||
{
|
||||
// Create & Start a new ToolsApplication if there's no existing one
|
||||
m_app = AZStd::make_unique<AzToolsFramework::ToolsApplication>();
|
||||
m_app = AZStd::make_unique<ToolsTestApplication>("ToolsApplication");
|
||||
m_app->Start(AzFramework::Application::Descriptor());
|
||||
}
|
||||
|
||||
@@ -204,7 +221,7 @@ namespace UnitTest
|
||||
ToolsApplicationMessageHandler m_messageHandler; // used to suppress trace messages in test output
|
||||
|
||||
private:
|
||||
AZStd::unique_ptr<AzToolsFramework::ToolsApplication> m_app;
|
||||
AZStd::unique_ptr<ToolsTestApplication> m_app;
|
||||
|
||||
// NewViewportInteractionModelEnabledRequestBus ...
|
||||
bool IsNewViewportInteractionModelEnabled() override
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzToolsFramework/UnitTest/ToolsTestApplication.h>
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
ToolsTestApplication::ToolsTestApplication(AZStd::string applicationName)
|
||||
: ToolsApplication()
|
||||
, m_applicationName(AZStd::move(applicationName))
|
||||
{
|
||||
}
|
||||
|
||||
void ToolsTestApplication::SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations)
|
||||
{
|
||||
Application::SetSettingsRegistrySpecializations(specializations);
|
||||
specializations.Append("test");
|
||||
specializations.Append(m_applicationName);
|
||||
}
|
||||
} // namespace UnitTest
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzToolsFramework/Application/ToolsApplication.h>
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
class ToolsTestApplication
|
||||
: public AzToolsFramework::ToolsApplication
|
||||
{
|
||||
public:
|
||||
explicit ToolsTestApplication(AZStd::string applicationName);
|
||||
void SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) override;
|
||||
|
||||
protected:
|
||||
AZStd::string m_applicationName;
|
||||
};
|
||||
} // namespace UnitTest
|
||||
Reference in New Issue
Block a user