From 009e96d601dec262c2c9564bf01c00be9bdc3eea Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 16 Jun 2021 10:02:36 -0700 Subject: [PATCH 1/6] fixing ly_test_tools function and unit tests --- .../managers/abstract_resource_locator.py | 39 ++++++++++++++++--- .../unit/test_abstract_resource_locator.py | 23 ++++++++--- .../tests/unit/test_builtin_helpers.py | 2 + .../tests/unit/test_manager_platforms_mac.py | 28 +++++++------ .../unit/test_manager_platforms_windows.py | 31 +++++++++------ 5 files changed, 90 insertions(+), 33 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py index ec4b43b023..c1a22e5641 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py @@ -14,7 +14,9 @@ Utility class to resolve Lumberyard directory paths & file mappings. import os import pathlib import warnings +import json from abc import ABCMeta, abstractmethod +from weakref import KeyedRef import ly_test_tools._internal.pytest_plugin from ly_test_tools.environment.file_system import find_ancestor_file @@ -50,11 +52,38 @@ def _find_project_json(engine_root, project): Find the project.json file for this project. :return: Full path to the project.json file """ - # First check relative to defined build directory, for external projects which configure through SDK settings - project_json = find_ancestor_file(target_file_name='project.json', - start_path=ly_test_tools._internal.pytest_plugin.build_directory) - if not project_json: # check internally for a project bundled with the engine - project_json = os.path.join(engine_root, project, 'project.json') + project_json = None + + # Check the o3de_manifest.json and for the "projects" key + manifest_json = os.path.join(os.path.expanduser('~'), '.o3de', 'o3de_manifest.json') + if os.path.isfile(manifest_json): + # Read the o3de_manifest.json + with open(manifest_json, "r") as manifest_file: + json_data = json.load(manifest_file) + # Look at the "projects" key for registered project paths + try: + for projects_path in json_data["projects"]: + # Only look at project directories that match our project + if project == os.path.basename(projects_path): + check_project_json = os.path.join(projects_path, 'project.json') + # Check for the project.json file inside of the project directory + if os.path.isfile(check_project_json): + project_json = check_project_json + except KeyError: + pass # No projects found in the manifest json + + # Check relative to defined build directory, for external projects which configure through SDK settings + if not project_json: + project_json = find_ancestor_file(target_file_name='project.json', + start_path=ly_test_tools._internal.pytest_plugin.build_directory) + # Check internally for a project bundled with the engine + if not project_json: + check_project_json = os.path.join(engine_root, project, 'project.json') + if os.path.isfile(check_project_json): + project_json = check_project_json + + if not project_json: + raise OSError(f"Unable to find the project directory for project: ${project}") return project_json diff --git a/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py b/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py index 12286b3dd7..a96f2a0699 100755 --- a/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py +++ b/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py @@ -24,6 +24,8 @@ mock_engine_root = "mock_engine_root" mock_dev_path = "mock_dev_path" mock_build_directory = 'mock_build_directory' mock_project = 'mock_project' +mock_manifest_json = {'projects': [mock_project]} +mock_project_json = os.path.join(mock_project, 'project.json') class TestFindEngineRoot(object): @@ -47,11 +49,24 @@ class TestFindEngineRoot(object): with pytest.raises(OSError): abstract_resource_locator._find_engine_root(mock_initial_path) +@mock.patch('builtins.open', mock.MagicMock()) +class TestFindProjectJson(object): + + @mock.patch('os.path.isfile', mock.MagicMock(return_value=True)) + @mock.patch('os.path.basename', mock.MagicMock(return_value=mock_project)) + @mock.patch('json.load', mock.MagicMock(return_value=mock_manifest_json)) + def test_FindProjectJson_ManifestJson_ReturnsProjectJson(self): + project = abstract_resource_locator._find_project_json(mock_engine_root, mock_project) + + assert project == mock_project_json + @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator.os.path.abspath', mock.MagicMock(return_value=mock_initial_path)) @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_engine_root', mock.MagicMock(return_value=mock_engine_root)) +@mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_project_json', + mock.MagicMock(return_value=os.path.join(mock_project, 'project.json'))) class TestAbstractResourceLocator(object): def test_Init_HasEngineRoot_SetsAttrs(self): @@ -93,12 +108,11 @@ class TestAbstractResourceLocator(object): assert mock_abstract_resource_locator.build_directory() == mock_build_directory - def test_Project_IsCalled_ReturnsProjectPath(self): + def test_Project_IsCalled_ReturnsProjectDir(self): mock_abstract_resource_locator = abstract_resource_locator.AbstractResourceLocator( mock_build_directory, mock_project) - expected_path = os.path.join(mock_abstract_resource_locator.engine_root(), mock_project) - assert mock_abstract_resource_locator.project() == expected_path + assert mock_abstract_resource_locator.project() == os.path.dirname(mock_project_json) def test_AssetProcessor_IsCalled_ReturnsAssetProcessorPath(self): mock_abstract_resource_locator = abstract_resource_locator.AbstractResourceLocator( @@ -168,8 +182,7 @@ class TestAbstractResourceLocator(object): def test_AutoexecFile_IsCalled_ReturnsAutoexecFilePath(self): mock_abstract_resource_locator = abstract_resource_locator.AbstractResourceLocator( mock_build_directory, mock_project) - expected_path = os.path.join(mock_abstract_resource_locator.engine_root(), - mock_abstract_resource_locator._project, + expected_path = os.path.join(mock_abstract_resource_locator._project, 'autoexec.cfg') assert mock_abstract_resource_locator.autoexec_file() == expected_path diff --git a/Tools/LyTestTools/tests/unit/test_builtin_helpers.py b/Tools/LyTestTools/tests/unit/test_builtin_helpers.py index a4ebf5acec..23a5a10bf3 100755 --- a/Tools/LyTestTools/tests/unit/test_builtin_helpers.py +++ b/Tools/LyTestTools/tests/unit/test_builtin_helpers.py @@ -68,6 +68,8 @@ class TestBuiltinHelpers(object): assert type(under_test) == expected_workspace + @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_project_json', + mock.MagicMock(return_value='mock_project')) @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager', mock.MagicMock(return_value=MockedWorkspaceManager)) @mock.patch('ly_test_tools.builtin.helpers.MAC', True) diff --git a/Tools/LyTestTools/tests/unit/test_manager_platforms_mac.py b/Tools/LyTestTools/tests/unit/test_manager_platforms_mac.py index bbd8fbf9ae..0acf6457d9 100755 --- a/Tools/LyTestTools/tests/unit/test_manager_platforms_mac.py +++ b/Tools/LyTestTools/tests/unit/test_manager_platforms_mac.py @@ -14,6 +14,7 @@ Unit tests for ly_test_tools._internal.managers.platforms.mac import unittest.mock as mock import os import pytest +import ly_test_tools from ly_test_tools._internal.managers.platforms.mac import ( _MacResourceLocator, MacWorkspaceManager, @@ -22,11 +23,6 @@ from ly_test_tools import MAC pytestmark = pytest.mark.SUITE_smoke -if not MAC: - pytestmark = pytest.mark.skipif( - not MAC, - reason="test_manager_platforms_mac.py only runs on Mac") - mock_engine_root = 'mock_engine_root' mock_dev_path = 'mock_dev_path' mock_build_directory = 'mock_build_directory' @@ -34,16 +30,16 @@ mock_project = 'mock_project' mock_tmp_path = 'mock_tmp_path' mock_output_path = 'mock_output_path' -mac_resource_locator = _MacResourceLocator( - build_directory=mock_build_directory, - project=mock_project) - @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_engine_root', - mock.MagicMock(return_value=(mock_engine_root, mock_dev_path))) + mock.MagicMock(return_value=mock_engine_root)) +@mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_project_json', + mock.MagicMock(return_value=mock_project)) class TestMacResourceLocator(object): def test_PlatformConfigFile_HasPath_ReturnsPath(self): + mac_resource_locator = ly_test_tools._internal.managers.platforms.mac._MacResourceLocator(mock_build_directory, + mock_project) expected = os.path.join( mac_resource_locator.engine_root(), CONFIG_FILE) @@ -51,6 +47,8 @@ class TestMacResourceLocator(object): assert mac_resource_locator.platform_config_file() == expected def test_PlatformCache_HasPath_ReturnsPath(self): + mac_resource_locator = ly_test_tools._internal.managers.platforms.mac._MacResourceLocator(mock_build_directory, + mock_project) expected = os.path.join( mac_resource_locator.project_cache(), CACHE_DIR) @@ -58,6 +56,8 @@ class TestMacResourceLocator(object): assert mac_resource_locator.platform_cache() == expected def test_ProjectLog_HasPath_ReturnsPath(self): + mac_resource_locator = ly_test_tools._internal.managers.platforms.mac._MacResourceLocator(mock_build_directory, + mock_project) expected = os.path.join( mac_resource_locator.project(), 'user', @@ -66,6 +66,8 @@ class TestMacResourceLocator(object): assert mac_resource_locator.project_log() == expected def test_ProjectScreenshots_HasPath_ReturnsPath(self): + mac_resource_locator = ly_test_tools._internal.managers.platforms.mac._MacResourceLocator(mock_build_directory, + mock_project) expected = os.path.join( mac_resource_locator.project(), 'user', @@ -74,6 +76,8 @@ class TestMacResourceLocator(object): assert mac_resource_locator.project_screenshots() == expected def test_EditorLog_HasPath_ReturnsPath(self): + mac_resource_locator = ly_test_tools._internal.managers.platforms.mac._MacResourceLocator(mock_build_directory, + mock_project) expected = os.path.join( mac_resource_locator.project_log(), 'editor.log') @@ -82,7 +86,9 @@ class TestMacResourceLocator(object): @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_engine_root', - mock.MagicMock(return_value=(mock_engine_root, mock_dev_path))) + mock.MagicMock(return_value=mock_engine_root)) +@mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_project_json', + mock.MagicMock(return_value=mock_project)) class TestMacWorkspaceManager(object): def test_Init_SetDummyParams_ReturnsMacWorkspaceManager(self): diff --git a/Tools/LyTestTools/tests/unit/test_manager_platforms_windows.py b/Tools/LyTestTools/tests/unit/test_manager_platforms_windows.py index aaf34367e7..93ca9e3c07 100755 --- a/Tools/LyTestTools/tests/unit/test_manager_platforms_windows.py +++ b/Tools/LyTestTools/tests/unit/test_manager_platforms_windows.py @@ -14,6 +14,7 @@ Unit tests for ly_test_tools._internal.managers.platforms.windows import unittest.mock as mock import os import pytest +import ly_test_tools from ly_test_tools._internal.managers.platforms.windows import ( _WindowsResourceLocator, WindowsWorkspaceManager, @@ -34,22 +35,16 @@ mock_project = 'mock_project' mock_tmp_path = 'mock_tmp_path' mock_output_path = 'mock_output_path' -windows_resource_locator = _WindowsResourceLocator( - build_directory=mock_build_directory, - project=mock_project) - -windows_workspace_manager = WindowsWorkspaceManager( - build_directory=mock_build_directory, - project=mock_project, - tmp_path=mock_tmp_path, - output_path=mock_output_path) - @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_engine_root', - mock.MagicMock(return_value=(mock_engine_root, mock_dev_path))) + mock.MagicMock(return_value=mock_engine_root)) +@mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_project_json', mock.MagicMock( + return_value=mock_project)) class TestWindowsResourceLocator(object): def test_PlatformConfigFile_HasPath_ReturnsPath(self): + windows_resource_locator = ly_test_tools._internal.managers.platforms.windows._WindowsResourceLocator( + mock_build_directory, mock_project) expected = os.path.join( windows_resource_locator.engine_root(), CONFIG_FILE) @@ -57,12 +52,16 @@ class TestWindowsResourceLocator(object): assert windows_resource_locator.platform_config_file() == expected def test_PlatformCache_HasPath_ReturnsPath(self): + windows_resource_locator = ly_test_tools._internal.managers.platforms.windows._WindowsResourceLocator( + mock_build_directory, mock_project) expected = os.path.join( windows_resource_locator.project_cache(), CACHE_DIR) assert windows_resource_locator.platform_cache() == expected def test_ProjectLog_HasPath_ReturnsPath(self): + windows_resource_locator = ly_test_tools._internal.managers.platforms.windows._WindowsResourceLocator( + mock_build_directory, mock_project) expected = os.path.join( windows_resource_locator.project(), 'user', @@ -71,6 +70,8 @@ class TestWindowsResourceLocator(object): assert windows_resource_locator.project_log() == expected def test_ProjectScreenshots_HasPath_ReturnsPath(self): + windows_resource_locator = ly_test_tools._internal.managers.platforms.windows._WindowsResourceLocator( + mock_build_directory, mock_project) expected = os.path.join( windows_resource_locator.project(), 'user', @@ -79,6 +80,8 @@ class TestWindowsResourceLocator(object): assert windows_resource_locator.project_screenshots() == expected def test_EditorLog_HasPath_ReturnsPath(self): + windows_resource_locator = ly_test_tools._internal.managers.platforms.windows._WindowsResourceLocator( + mock_build_directory, mock_project) expected = os.path.join( windows_resource_locator.project_log(), 'editor.log') @@ -87,17 +90,21 @@ class TestWindowsResourceLocator(object): @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_engine_root', - mock.MagicMock(return_value=(mock_engine_root, mock_dev_path))) + mock.MagicMock(return_value=mock_engine_root)) +@mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_project_json', mock.MagicMock( + return_value=mock_project)) class TestWindowsWorkspaceManager(object): @mock.patch('ly_test_tools.environment.reg_cleaner.create_ly_keys') def test_SetRegistryKeys_NewWorkspaceManager_KeyCreateCalled(self, mock_create_keys): + windows_workspace_manager = ly_test_tools._internal.managers.platforms.windows.WindowsWorkspaceManager() windows_workspace_manager.set_registry_keys() mock_create_keys.assert_called_once() @mock.patch('ly_test_tools.environment.reg_cleaner.clean_ly_keys') def test_ClearSettings_NewWorkspaceManager_KeyClearCalled(self, mock_clear_keys): + windows_workspace_manager = ly_test_tools._internal.managers.platforms.windows.WindowsWorkspaceManager() windows_workspace_manager.clear_settings() mock_clear_keys.assert_called_with(exception_list=r"SOFTWARE\Amazon\Lumberyard\Identity") From 017845e285e7fb58996abac4164ddcaf9d007541 Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 16 Jun 2021 11:29:14 -0700 Subject: [PATCH 2/6] fixing project() func to read project.json --- .../managers/abstract_resource_locator.py | 15 +++++++++------ .../tests/unit/test_abstract_resource_locator.py | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py index c1a22e5641..a7a1c867f6 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py @@ -63,12 +63,15 @@ def _find_project_json(engine_root, project): # Look at the "projects" key for registered project paths try: for projects_path in json_data["projects"]: - # Only look at project directories that match our project - if project == os.path.basename(projects_path): - check_project_json = os.path.join(projects_path, 'project.json') - # Check for the project.json file inside of the project directory - if os.path.isfile(check_project_json): - project_json = check_project_json + check_project_json = os.path.join(projects_path, 'project.json') + # Check for the project.json file inside of the project directory + if os.path.isfile(check_project_json): + # Check if the "project_name" key matches our project + with open(check_project_json, "r") as project_json_file: + project_json_data = json.load(project_json_file) + if project == project_json_data["project_name"]: + project_json = check_project_json + break except KeyError: pass # No projects found in the manifest json diff --git a/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py b/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py index a96f2a0699..d8e4e5a14a 100755 --- a/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py +++ b/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py @@ -24,7 +24,8 @@ mock_engine_root = "mock_engine_root" mock_dev_path = "mock_dev_path" mock_build_directory = 'mock_build_directory' mock_project = 'mock_project' -mock_manifest_json = {'projects': [mock_project]} +mock_manifest_json_file = {'projects': [mock_project]} +mock_project_json_file = {'project_name': mock_project} mock_project_json = os.path.join(mock_project, 'project.json') @@ -54,7 +55,7 @@ class TestFindProjectJson(object): @mock.patch('os.path.isfile', mock.MagicMock(return_value=True)) @mock.patch('os.path.basename', mock.MagicMock(return_value=mock_project)) - @mock.patch('json.load', mock.MagicMock(return_value=mock_manifest_json)) + @mock.patch('json.load', mock.MagicMock(side_effect=[mock_manifest_json_file, mock_project_json_file])) def test_FindProjectJson_ManifestJson_ReturnsProjectJson(self): project = abstract_resource_locator._find_project_json(mock_engine_root, mock_project) From cf7f1defebad748776b1f7d3e4cafd1eaf19bdec Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 16 Jun 2021 14:45:11 -0700 Subject: [PATCH 3/6] added warning message --- .../_internal/managers/abstract_resource_locator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py index a7a1c867f6..48afeb8219 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py @@ -15,12 +15,14 @@ import os import pathlib import warnings import json +import logging from abc import ABCMeta, abstractmethod from weakref import KeyedRef import ly_test_tools._internal.pytest_plugin from ly_test_tools.environment.file_system import find_ancestor_file +logger = logging.getLogger(__name__) def _find_engine_root(initial_path): # type: (str) -> str @@ -72,8 +74,8 @@ def _find_project_json(engine_root, project): if project == project_json_data["project_name"]: project_json = check_project_json break - except KeyError: - pass # No projects found in the manifest json + except KeyError as err: + logger.warning(f"Project key could not be found due to error: {err}") # Check relative to defined build directory, for external projects which configure through SDK settings if not project_json: From 709bca5849f2d06dc6611dee6babf1640e1f491b Mon Sep 17 00:00:00 2001 From: mriegger Date: Wed, 16 Jun 2021 20:15:08 -0700 Subject: [PATCH 4/6] Adding code that prevents nans occuring due to precision issues --- .../Common/Assets/ShaderLib/Atom/Features/Shadow/Shadow.azsli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/Shadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/Shadow.azsli index d267a74b36..138ea38562 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/Shadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/Shadow.azsli @@ -79,9 +79,9 @@ float4 Shadow::GetJitterUnitVectorDepthDiffBase( return float4(0., 0., 0., 0.); } const float3 v_M = v_M0 / v_M0_length; - const float cosTheta = dot(normalVector, v_M); + const float cosTheta = saturate(dot(normalVector, v_M)); const float sinTheta = sqrt(1 - cosTheta * cosTheta); - if (sinTheta == 0.) + if (sinTheta < 0.001) { return float4(0., 0., 0., 0.); } From c0d9db6739ca36806759587b3a9432fea3998ed4 Mon Sep 17 00:00:00 2001 From: Eric Phister <52085794+amzn-phist@users.noreply.github.com> Date: Thu, 17 Jun 2021 10:29:28 -0500 Subject: [PATCH 5/6] Fixes for SDK include directory structure (#1319) * Updates the install of SDK includes Needs some fixes so that public include paths that were going up directories or had multiple path components would resolve to correct destination paths during install. * Updates the logic to fix AutoGen includes AutoGen headers were a special case because matching relative paths failed due to the headers existing under the build path. * Removes trailling slashes from inc dirs This addresses a quirk in CMake where installing a directory with a trailing slash has different behavior than one without. The include paths being processed had a wide mix of slash or not. * Update cmake/Platform/Common/Install_common.cmake Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixes fatal errors in the last change The call to cmake_path IS_PREFIX was ill-formed. Also the trailing directory separator was being removed from the DESTINATION but really needed to be removed from the DIRECTORY. Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- cmake/Platform/Common/Install_common.cmake | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 933d64149b..bf7134d470 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -42,8 +42,20 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME) string(GENEX_STRIP ${include_directory} include_genex_expr) if(include_genex_expr STREQUAL include_directory) # only for cases where there are no generation expressions unset(current_public_headers) + + cmake_path(NORMAL_PATH include_directory) + string(REGEX REPLACE "/$" "" include_directory "${include_directory}") + cmake_path(IS_PREFIX LY_ROOT_FOLDER ${absolute_target_source_dir} NORMALIZE include_directory_child_of_o3de_root) + if(NOT include_directory_child_of_o3de_root) + message(FATAL_ERROR "Include directory of \"${include_directory}\" is outside of the O3DE root folder of \"${LY_ROOT_FOLDER}\". For the INSTALL step, the O3DE root folder must be a prefix of all include directories") + endif() + + cmake_path(RELATIVE_PATH include_directory BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE rel_include_dir) + cmake_path(APPEND include_location "${rel_include_dir}" ".." OUTPUT_VARIABLE destination_dir) + cmake_path(NORMAL_PATH destination_dir) + install(DIRECTORY ${include_directory} - DESTINATION ${include_location}/${target_source_dir} + DESTINATION ${destination_dir} COMPONENT ${install_component} FILES_MATCHING PATTERN *.h @@ -116,7 +128,9 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME) string(GENEX_STRIP ${include} include_genex_expr) if(include_genex_expr STREQUAL include) # only for cases where there are no generation expressions file(RELATIVE_PATH relative_include ${absolute_target_source_dir} ${include}) - string(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "\${LY_ROOT_FOLDER}/include/${target_source_dir}/${relative_include}\n") + cmake_path(APPEND include_location "${target_source_dir}" "${relative_include}" OUTPUT_VARIABLE target_include) + cmake_path(NORMAL_PATH target_include) + string(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "\${LY_ROOT_FOLDER}/${target_include}\n") endif() endforeach() endif() From b9fbfac96703a6fb39f03b551e3cab3cf465f0cc Mon Sep 17 00:00:00 2001 From: Aaron Ruiz Mora Date: Thu, 17 Jun 2021 17:19:50 +0100 Subject: [PATCH 6/6] Fixed Physics Materials periodic automated tests (#1396) --- .../PythonTests/physics/TestSuite_Periodic.py | 7 ++ ...ntrollerMaterialAssignment.setreg_override | 115 ++++++++++++++++++ ...al_FrictionCombinePriority.setreg_override | 115 ++++++++++++++++++ ...RestitutionCombinePriority.setreg_override | 115 ++++++++++++++++++ ...6_Material_FrictionCombine.setreg_override | 115 ++++++++++++++++++ ...aterial_RestitutionCombine.setreg_override | 115 ++++++++++++++++++ ...44461_Material_Restitution.setreg_override | 115 ++++++++++++++++++ ..._PerfaceMaterialValidation.setreg_override | 115 ++++++++++++++++++ 8 files changed, 812 insertions(+) create mode 100644 AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override create mode 100644 AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override create mode 100644 AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override create mode 100644 AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override create mode 100644 AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override create mode 100644 AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override create mode 100644 AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py index 2b82c3e596..291bb96627 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Periodic.py @@ -93,11 +93,13 @@ class TestAutomation(TestAutomationBase): self._run_test(request, workspace, editor, test_module) @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C4044457_Material_RestitutionCombine.setreg_override', 'AutomatedTesting/Registry') def test_C4044457_Material_RestitutionCombine(self, request, workspace, editor, launcher_platform): from . import C4044457_Material_RestitutionCombine as test_module self._run_test(request, workspace, editor, test_module) @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C4044456_Material_FrictionCombine.setreg_override', 'AutomatedTesting/Registry') def test_C4044456_Material_FrictionCombine(self, request, workspace, editor, launcher_platform): from . import C4044456_Material_FrictionCombine as test_module self._run_test(request, workspace, editor, test_module) @@ -194,6 +196,7 @@ class TestAutomation(TestAutomationBase): self._run_test(request, workspace, editor, test_module) @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C18981526_Material_RestitutionCombinePriority.setreg_override', 'AutomatedTesting/Registry') def test_C18981526_Material_RestitutionCombinePriority(self, request, workspace, editor, launcher_platform): from . import C18981526_Material_RestitutionCombinePriority as test_module self._run_test(request, workspace, editor, test_module) @@ -229,6 +232,7 @@ class TestAutomation(TestAutomationBase): self._run_test(request, workspace, editor, test_module) @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C18977601_Material_FrictionCombinePriority.setreg_override', 'AutomatedTesting/Registry') def test_C18977601_Material_FrictionCombinePriority(self, request, workspace, editor, launcher_platform): from . import C18977601_Material_FrictionCombinePriority as test_module self._run_test(request, workspace, editor, test_module) @@ -250,6 +254,7 @@ class TestAutomation(TestAutomationBase): @pytest.mark.xfail( reason="This test needs new physics asset with multiple materials to be more stable.") @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C4044697_Material_PerfaceMaterialValidation.setreg_override', 'AutomatedTesting/Registry') def test_C4044697_Material_PerfaceMaterialValidation(self, request, workspace, editor, launcher_platform): from . import C4044697_Material_PerfaceMaterialValidation as test_module self._run_test(request, workspace, editor, test_module) @@ -282,6 +287,7 @@ class TestAutomation(TestAutomationBase): self._run_test(request, workspace, editor, test_module) @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override', 'AutomatedTesting/Registry') def test_C15556261_PhysXMaterials_CharacterControllerMaterialAssignment(self, request, workspace, editor, launcher_platform): from . import C15556261_PhysXMaterials_CharacterControllerMaterialAssignment as test_module self._run_test(request, workspace, editor, test_module) @@ -326,6 +332,7 @@ class TestAutomation(TestAutomationBase): self._run_test(request, workspace, editor, test_module) @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C4044461_Material_Restitution.setreg_override', 'AutomatedTesting/Registry') def test_C4044461_Material_Restitution(self, request, workspace, editor, launcher_platform): from . import C4044461_Material_Restitution as test_module self._run_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override b/AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override new file mode 100644 index 0000000000..a329434623 --- /dev/null +++ b/AutomatedTesting/Registry/C15556261_PhysXMaterials_CharacterControllerMaterialAssignment.setreg_override @@ -0,0 +1,115 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "MaterialLibrary": { + "assetId": { + "guid": "{70D4A444-AFD4-57C4-9885-63F25AC3C281}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c15556261_physxmaterials_charactercontrollermaterialassignment/library.physmaterial" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override b/AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override new file mode 100644 index 0000000000..44a91c67cb --- /dev/null +++ b/AutomatedTesting/Registry/C18977601_Material_FrictionCombinePriority.setreg_override @@ -0,0 +1,115 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "MaterialLibrary": { + "assetId": { + "guid": "{B8749DAB-15DA-5A61-B565-C853673604CD}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c18977601_material_frictioncombinepriority/friction_combine.physmaterial" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override b/AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override new file mode 100644 index 0000000000..8de10787f1 --- /dev/null +++ b/AutomatedTesting/Registry/C18981526_Material_RestitutionCombinePriority.setreg_override @@ -0,0 +1,115 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "MaterialLibrary": { + "assetId": { + "guid": "{AED48B18-0F3F-5E59-A8FF-30DB134B307B}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c18981526_material_restitutioncombinepriority/restitution_combine.physmaterial" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override b/AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override new file mode 100644 index 0000000000..83f7079e1f --- /dev/null +++ b/AutomatedTesting/Registry/C4044456_Material_FrictionCombine.setreg_override @@ -0,0 +1,115 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "MaterialLibrary": { + "assetId": { + "guid": "{8D2C4A29-E0FC-564F-82C9-24BBA30C5A90}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c4044456_material_frictioncombine/friction_combine.physmaterial" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override b/AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override new file mode 100644 index 0000000000..96836b6ae4 --- /dev/null +++ b/AutomatedTesting/Registry/C4044457_Material_RestitutionCombine.setreg_override @@ -0,0 +1,115 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "MaterialLibrary": { + "assetId": { + "guid": "{D5D6A6DE-E636-5638-B30D-6CE2FDC321F8}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c4044457_material_restitutioncombine/restitution_combine.physmaterial" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override b/AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override new file mode 100644 index 0000000000..21b285506b --- /dev/null +++ b/AutomatedTesting/Registry/C4044461_Material_Restitution.setreg_override @@ -0,0 +1,115 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "MaterialLibrary": { + "assetId": { + "guid": "{E4117B5B-8D9A-5C1D-BA1E-C36542A6588D}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c4044461_material_restitution/restitution.physmaterial" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override b/AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override new file mode 100644 index 0000000000..d585a4c468 --- /dev/null +++ b/AutomatedTesting/Registry/C4044697_Material_PerfaceMaterialValidation.setreg_override @@ -0,0 +1,115 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "MaterialLibrary": { + "assetId": { + "guid": "{2E85B457-ED19-5FE3-90B4-6EFFB4D0E682}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c4044697_material_perfacematerialvalidation/test_library.physmaterial" + } + } + } + } + } +} \ No newline at end of file