fixes and cmake changes to get it to compile
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -52,3 +52,63 @@ ly_add_source_properties(
|
||||
PROPERTY COMPILE_DEFINITIONS
|
||||
VALUES TOUCHBENDING_LAYER_BIT=${LY_TOUCHBENDING_LAYER_BIT}
|
||||
)
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
ly_add_target(
|
||||
NAME AzFrameworkTestShared STATIC
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
Tests/framework_shared_tests_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PUBLIC
|
||||
Tests
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzCore
|
||||
AZ::AzFramework
|
||||
)
|
||||
|
||||
if(PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
|
||||
ly_add_target(
|
||||
NAME ProcessLaunchTest EXECUTABLE
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
Tests/process_launch_test_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Tests
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzCore
|
||||
AZ::AzFramework
|
||||
)
|
||||
|
||||
ly_add_target(
|
||||
NAME AzFramework.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
Tests/frameworktests_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Tests
|
||||
${pal_dir}
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzFramework
|
||||
AZ::AzTest
|
||||
AZ::AzTestShared
|
||||
AZ::AzFrameworkTestShared
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::ProcessLaunchTest
|
||||
)
|
||||
ly_add_googletest(
|
||||
NAME AZ::AzFramework.Tests
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
@@ -1,64 +0,0 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
ly_add_target(
|
||||
NAME AzFrameworkTestShared STATIC
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
framework_shared_tests_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PUBLIC
|
||||
.
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzCore
|
||||
AZ::AzFramework
|
||||
)
|
||||
|
||||
if(PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_target(
|
||||
NAME ProcessLaunchTest EXECUTABLE
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
process_launch_test_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
.
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzCore
|
||||
AZ::AzFramework
|
||||
)
|
||||
|
||||
ly_add_target(
|
||||
NAME Framework.Tests ${PAL_TRAIT_TEST_TARGET_TYPE}
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
frameworktests_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
.
|
||||
${pal_dir}
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzTest
|
||||
AZ::AzToolsFramework
|
||||
AZ::AzTestShared
|
||||
AZ::AzFrameworkTestShared
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::ProcessLaunchTest
|
||||
)
|
||||
ly_add_googletest(
|
||||
NAME AZ::Framework.Tests
|
||||
)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
@@ -15,16 +15,16 @@ namespace UnitTest
|
||||
{
|
||||
using namespace AZ;
|
||||
|
||||
class SetRestoreFileIOBaseRAII
|
||||
class FileIOBaseRAII
|
||||
{
|
||||
public:
|
||||
SetRestoreFileIOBaseRAII(AZ::IO::FileIOBase& fileIO)
|
||||
FileIOBaseRAII(AZ::IO::FileIOBase& fileIO)
|
||||
: m_prevFileIO(AZ::IO::FileIOBase::GetInstance())
|
||||
{
|
||||
AZ::IO::FileIOBase::SetInstance(&fileIO);
|
||||
}
|
||||
|
||||
~SetRestoreFileIOBaseRAII()
|
||||
~FileIOBaseRAII()
|
||||
{
|
||||
AZ::IO::FileIOBase::SetInstance(m_prevFileIO);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ namespace UnitTest
|
||||
TEST_F(GenAppDescriptors, Test)
|
||||
{
|
||||
AZ::IO::LocalFileIO fileIO;
|
||||
SetRestoreFileIOBaseRAII restoreFileIOScope(fileIO);
|
||||
FileIOBaseRAII restoreFileIOScope(fileIO);
|
||||
run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(, "-Wdelete-non-virtual-dtor")
|
||||
|
||||
#include <FrameworkApplicationFixture.h>
|
||||
#include <AzCore/Component/ComponentApplication.h>
|
||||
#include <AzCore/Component/Entity.h>
|
||||
#include <AzCore/Component/Component.h>
|
||||
|
||||
@@ -9,4 +9,5 @@ set(FILES
|
||||
Mocks/MockSpawnableEntitiesInterface.h
|
||||
Utils/Utils.h
|
||||
Utils/Utils.cpp
|
||||
FrameworkApplicationFixture.h
|
||||
)
|
||||
|
||||
@@ -6,44 +6,28 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../AzCore/Tests/Main.cpp
|
||||
../../AzCore/Tests/Main.cpp
|
||||
Spawnable/SpawnableEntitiesManagerTests.cpp
|
||||
ArchiveCompressionTests.cpp
|
||||
ArchiveTests.cpp
|
||||
BehaviorEntityTests.cpp
|
||||
BinToTextEncode.cpp
|
||||
ComponentAddRemove.cpp
|
||||
ComponentAdapterTests.cpp
|
||||
CameraInputTests.cpp
|
||||
ClickDetectorTests.cpp
|
||||
CursorStateTests.cpp
|
||||
EntityContext.cpp
|
||||
EntityTestbed.h
|
||||
FileFunc.cpp
|
||||
FileIO.cpp
|
||||
FileTagTests.cpp
|
||||
FrameworkApplicationFixture.h
|
||||
GenAppDescriptors.cpp
|
||||
GenericComponentWrapperTest.cpp
|
||||
InstanceDataHierarchy.cpp
|
||||
OctreePerformanceTests.cpp
|
||||
OctreeTests.cpp
|
||||
Slices.cpp
|
||||
Script/ScriptComponentTests.cpp
|
||||
Script/ScriptEntityTests.cpp
|
||||
AssetCatalog.cpp
|
||||
AssetProcessorConnection.cpp
|
||||
NativeWindow.cpp
|
||||
TransformComponent.cpp
|
||||
SQLiteConnectionTests.cpp
|
||||
ProcessLaunchParseTests.cpp
|
||||
Application.cpp
|
||||
PlatformHelper.cpp
|
||||
Scene.cpp
|
||||
EntityOwnershipService/EntityOwnershipServiceTestFixture.h
|
||||
EntityOwnershipService/EntityOwnershipServiceTestFixture.cpp
|
||||
EntityOwnershipService/SliceEditorEntityOwnershipTests.cpp
|
||||
EntityOwnershipService/SliceEntityOwnershipTests.cpp
|
||||
CameraState.cpp
|
||||
InputTests.cpp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user