Merged the Editor.Camera.Tests with the Editor.Tests (#5463)

* Merged the Edtiror.Camera.Tests witht eh Editor.Tests

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Adds dependency to Camera.Editor gem which is used by the test

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Inheirts from TraceBusHook instead of adding the default env to the test

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* makes order consistent between Setup/Teardown

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* adds missing header for non-unity builds

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Removes dependency to Camera gem

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-11-10 08:57:39 -08:00
committed by GitHub
parent ab37eb138c
commit 21f9a789c1
8 changed files with 39 additions and 81 deletions
+8 -3
View File
@@ -9,12 +9,13 @@
#include "EditorDefs.h"
#include <AzTest/AzTest.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/UnitTest/UnitTest.h>
#include <EditorEnvironment.h>
#include <QApplication>
class EditorLibTestEnvironment
: public AZ::Test::ITestEnvironment
: public ::UnitTest::TraceBusHook
{
public:
~EditorLibTestEnvironment() override = default;
@@ -22,16 +23,20 @@ public:
protected:
void SetupEnvironment() override
{
::UnitTest::TraceBusHook::SetupEnvironment();
AZ::Environment::Create(nullptr);
AttachEditorAZEnvironment(AZ::Environment::GetInstance());
AZ::AllocatorInstance<AZ::SystemAllocator>::Create();
AttachEditorAZEnvironment(AZ::Environment::GetInstance());
}
void TeardownEnvironment() override
{
AZ::AllocatorInstance<AZ::SystemAllocator>::Destroy();
DetachEditorAZEnvironment();
AZ::AllocatorInstance<AZ::SystemAllocator>::Destroy();
AZ::Environment::Destroy();
::UnitTest::TraceBusHook::TeardownEnvironment();
}
};