diff --git a/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt b/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt index a753914c4b..20a680bce9 100644 --- a/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt @@ -1,21 +1,12 @@ - -set(o3de_gem_path ${CMAKE_CURRENT_LIST_DIR}) -set(o3de_gem_json ${o3de_gem_path}/gem.json) -o3de_read_json_key(o3de_gem_name ${o3de_gem_json} "gem_name") -o3de_restricted_path(${o3de_gem_json} o3de_gem_restricted_path) - -# Currently we are in the DefaultProjectSource folder: ${CMAKE_CURRENT_LIST_DIR} -# Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform -# in which case it will see if that platform is present here or in the restricted folder. -# i.e. It could here: DefaultProjectSource/Platform/ or -# //DefaultProjectSource -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) - -# Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the -# project cmake for this platform. -include(${pal_dir}/${PAL_PLATFORM_NAME_LOWERCASE}_gem.cmake) - -ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) +# +# 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. +# add_subdirectory(Code) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt b/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt index c288377483..570150758d 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt @@ -1,127 +1,74 @@ +# +# 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. +# -# Currently we are in the Code folder: ${CMAKE_CURRENT_LIST_DIR} -# Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform -# in which case it will see if that platform is present here or in the restricted folder. -# i.e. It could here in our gem : Gems/PythonCoverage/Code/Platform/ or -# //Gems/PythonCoverage/Code ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) - -# Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the -# traits for this platform. Traits for a platform are defines for things like whether or not something in this gem -# is supported by this platform. include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) -# Add the PythonCoverage.Static target -# Note: We include the common files and the platform specific files which are set in pythoncoverage_common_files.cmake -# and in ${pal_dir}/pythoncoverage_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake -ly_add_target( - NAME PythonCoverage.Static STATIC - NAMESPACE Gem - FILES_CMAKE - pythoncoverage_files.cmake - ${pal_dir}/pythoncoverage_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake - INCLUDE_DIRECTORIES - PUBLIC - Include - PRIVATE - Source - BUILD_DEPENDENCIES - PUBLIC - AZ::AzCore - AZ::AzFramework -) - -# Here add PythonCoverage target, it depends on the PythonCoverage.Static -ly_add_target( - NAME PythonCoverage ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} - NAMESPACE Gem - FILES_CMAKE - pythoncoverage_shared_files.cmake - ${pal_dir}/pythoncoverage_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake - INCLUDE_DIRECTORIES - PUBLIC - Include - PRIVATE - Source - BUILD_DEPENDENCIES - PRIVATE - Gem::PythonCoverage.Static -) - -# By default, we will specify that the above target PythonCoverage would be used by -# Client and Server type targets when this gem is enabled. If you don't want it -# active in Clients or Servers by default, delete one of both of the following lines: -ly_create_alias(NAME PythonCoverage.Clients NAMESPACE Gem TARGETS Gem::PythonCoverage) -ly_create_alias(NAME PythonCoverage.Servers NAMESPACE Gem TARGETS Gem::PythonCoverage) - -# If we are on a host platform, we want to add the host tools targets like the PythonCoverage.Editor target which -# will also depend on PythonCoverage.Static -if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_target( - NAME PythonCoverage.Editor.Static STATIC - NAMESPACE Gem - FILES_CMAKE - pythoncoverage_editor_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Source - PUBLIC - Include - COMPILE_DEFINITIONS - PUBLIC - PYTHON_COVERAGE_EDITOR - PRIVATE - LY_TEST_IMPACT_DEFAULT_CONFIG_FILE=\"\" - BUILD_DEPENDENCIES - PUBLIC - AZ::AzToolsFramework - Gem::PythonCoverage.Static - ) - - ly_add_target( - NAME PythonCoverage.Editor MODULE - NAMESPACE Gem - AUTOMOC - OUTPUT_NAME Gem.PythonCoverage.Editor - FILES_CMAKE - pythoncoverage_editor_shared_files.cmake - COMPILE_DEFINITIONS - PRIVATE - PYTHON_COVERAGE_EDITOR - INCLUDE_DIRECTORIES - PRIVATE - Source - PUBLIC - Include - BUILD_DEPENDENCIES - PUBLIC - Gem::PythonCoverage.Editor.Static - ) - - # By default, we will specify that the above target PythonCoverage would be used by - # Tool and Builder type targets when this gem is enabled. If you don't want it - # active in Tools or Builders by default, delete one of both of the following lines: - ly_create_alias(NAME PythonCoverage.Tools NAMESPACE Gem TARGETS Gem::PythonCoverage.Editor) - ly_create_alias(NAME PythonCoverage.Builders NAMESPACE Gem TARGETS Gem::PythonCoverage.Editor) +if(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED) + if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME PythonCoverage.Editor.Static STATIC + NAMESPACE Gem + FILES_CMAKE + pythoncoverage_editor_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Source + PUBLIC + Include + COMPILE_DEFINITIONS + PUBLIC + PYTHON_COVERAGE_EDITOR + PRIVATE + LY_TEST_IMPACT_DEFAULT_CONFIG_FILE=\"\" + BUILD_DEPENDENCIES + PUBLIC + AZ::AzToolsFramework + ) + ly_add_target( + NAME PythonCoverage.Editor MODULE + NAMESPACE Gem + AUTOMOC + OUTPUT_NAME Gem.PythonCoverage.Editor + FILES_CMAKE + pythoncoverage_editor_shared_files.cmake + COMPILE_DEFINITIONS + PRIVATE + PYTHON_COVERAGE_EDITOR + INCLUDE_DIRECTORIES + PRIVATE + Source + PUBLIC + Include + BUILD_DEPENDENCIES + PUBLIC + Gem::PythonCoverage.Editor.Static + ) + # By default, we will specify that the above target PythonCoverage would be used by + # Tool and Builder type targets when this gem is enabled. If you don't want it + # active in Tools or Builders by default, delete one of both of the following lines: + ly_create_alias(NAME PythonCoverage.Tools NAMESPACE Gem TARGETS Gem::PythonCoverage.Editor) + ly_create_alias(NAME PythonCoverage.Builders NAMESPACE Gem TARGETS Gem::PythonCoverage.Editor) + endif() endif() -################################################################################ -# Tests -################################################################################ -# See if globally, tests are supported if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - # We globally support tests, see if we support tests on this platform for PythonCoverage.Static - if(PAL_TRAIT_PYTHONCOVERAGE_TEST_SUPPORTED) - # We support PythonCoverage.Tests on this platform, add PythonCoverage.Tests target which depends on PythonCoverage.Static + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( - NAME PythonCoverage.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAME PythonCoverage.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem FILES_CMAKE - pythoncoverage_files.cmake - pythoncoverage_tests_files.cmake + pythoncoverage_editor_tests_files.cmake INCLUDE_DIRECTORIES PRIVATE Tests @@ -129,40 +76,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - AZ::AzFramework - Gem::PythonCoverage.Static + Gem::PythonCoverage.Editor ) - # Add PythonCoverage.Tests to googletest ly_add_googletest( - NAME Gem::PythonCoverage.Tests + NAME Gem::PythonCoverage.Editor.Tests ) endif() - - # If we are a host platform we want to add tools test like editor tests here - if(PAL_TRAIT_BUILD_HOST_TOOLS) - # We are a host platform, see if Editor tests are supported on this platform - if(PAL_TRAIT_PYTHONCOVERAGE_EDITOR_TEST_SUPPORTED) - # We support PythonCoverage.Editor.Tests on this platform, add PythonCoverage.Editor.Tests target which depends on PythonCoverage.Editor - ly_add_target( - NAME PythonCoverage.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - pythoncoverage_editor_tests_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Tests - Source - BUILD_DEPENDENCIES - PRIVATE - AZ::AzTest - Gem::PythonCoverage.Editor - ) - - # Add PythonCoverage.Editor.Tests to googletest - ly_add_googletest( - NAME Gem::PythonCoverage.Editor.Tests - ) - endif() - endif() -endif() +endif() \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/PAL_android.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/PAL_android.cmake index 1be29fc854..7385380639 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/PAL_android.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/PAL_android.cmake @@ -1,4 +1,12 @@ +# +# 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. +# -set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_TEST_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_EDITOR_TEST_SUPPORTED TRUE) +set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED FALSE) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_android_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_android_files.cmake deleted file mode 100644 index d337110ed9..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_android_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Android -# i.e. ../Source/Android/PythonCoverageAndroid.cpp -# ../Source/Android/PythonCoverageAndroid.h -# ../Include/Android/PythonCoverageAndroid.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_editor_shared_android_files - Copy.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_editor_shared_android_files - Copy.cmake deleted file mode 100644 index d337110ed9..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_editor_shared_android_files - Copy.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Android -# i.e. ../Source/Android/PythonCoverageAndroid.cpp -# ../Source/Android/PythonCoverageAndroid.h -# ../Include/Android/PythonCoverageAndroid.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_shared_android_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_shared_android_files.cmake deleted file mode 100644 index d337110ed9..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Android/pythoncoverage_shared_android_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Android -# i.e. ../Source/Android/PythonCoverageAndroid.cpp -# ../Source/Android/PythonCoverageAndroid.h -# ../Include/Android/PythonCoverageAndroid.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/PAL_linux.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/PAL_linux.cmake index bf0d788480..7385380639 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/PAL_linux.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/PAL_linux.cmake @@ -1,4 +1,12 @@ +# +# 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. +# -set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_TEST_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_EDITOR_TEST_SUPPORTED TRUE) \ No newline at end of file +set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED FALSE) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_editor_shared_linux_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_editor_shared_linux_files.cmake deleted file mode 100644 index 7c08fd3b2f..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_editor_shared_linux_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Linux -# i.e. ../Source/Linux/PythonCoverageLinux.cpp -# ../Source/Linux/PythonCoverageLinux.h -# ../Include/Linux/PythonCoverageLinux.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_linux_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_linux_files.cmake deleted file mode 100644 index 7c08fd3b2f..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_linux_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Linux -# i.e. ../Source/Linux/PythonCoverageLinux.cpp -# ../Source/Linux/PythonCoverageLinux.h -# ../Include/Linux/PythonCoverageLinux.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_shared_linux_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_shared_linux_files.cmake deleted file mode 100644 index 7c08fd3b2f..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Linux/pythoncoverage_shared_linux_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Linux -# i.e. ../Source/Linux/PythonCoverageLinux.cpp -# ../Source/Linux/PythonCoverageLinux.h -# ../Include/Linux/PythonCoverageLinux.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/PAL_mac.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/PAL_mac.cmake index bf0d788480..7385380639 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/PAL_mac.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/PAL_mac.cmake @@ -1,4 +1,12 @@ +# +# 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. +# -set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_TEST_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_EDITOR_TEST_SUPPORTED TRUE) \ No newline at end of file +set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED FALSE) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_editor_shared_mac_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_editor_shared_mac_files.cmake deleted file mode 100644 index 1a11934818..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_editor_shared_mac_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Mac -# i.e. ../Source/Mac/PythonCoverageMac.cpp -# ../Source/Mac/PythonCoverageMac.h -# ../Include/Mac/PythonCoverageMac.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_mac_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_mac_files.cmake deleted file mode 100644 index 1a11934818..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_mac_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Mac -# i.e. ../Source/Mac/PythonCoverageMac.cpp -# ../Source/Mac/PythonCoverageMac.h -# ../Include/Mac/PythonCoverageMac.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_shared_mac_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_shared_mac_files.cmake deleted file mode 100644 index 1a11934818..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Mac/pythoncoverage_shared_mac_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Mac -# i.e. ../Source/Mac/PythonCoverageMac.cpp -# ../Source/Mac/PythonCoverageMac.h -# ../Include/Mac/PythonCoverageMac.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/PAL_windows.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/PAL_windows.cmake index bf0d788480..99b5ab4780 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/PAL_windows.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/PAL_windows.cmake @@ -1,4 +1,12 @@ +# +# 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. +# set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_TEST_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_EDITOR_TEST_SUPPORTED TRUE) \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_editor_windows_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_editor_windows_files.cmake deleted file mode 100644 index b4c8689f5f..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_editor_windows_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Windows -# i.e. ../Source/Windows/PythonCoverageWindows.cpp -# ../Source/Windows/PythonCoverageWindows.h -# ../Include/Windows/PythonCoverageWindows.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_shared_windows_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_shared_windows_files.cmake deleted file mode 100644 index b4c8689f5f..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_shared_windows_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Windows -# i.e. ../Source/Windows/PythonCoverageWindows.cpp -# ../Source/Windows/PythonCoverageWindows.h -# ../Include/Windows/PythonCoverageWindows.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_windows_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_windows_files.cmake deleted file mode 100644 index b4c8689f5f..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/Windows/pythoncoverage_windows_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for Windows -# i.e. ../Source/Windows/PythonCoverageWindows.cpp -# ../Source/Windows/PythonCoverageWindows.h -# ../Include/Windows/PythonCoverageWindows.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/PAL_ios.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/PAL_ios.cmake index bf0d788480..7385380639 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/PAL_ios.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/PAL_ios.cmake @@ -1,4 +1,12 @@ +# +# 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. +# -set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_TEST_SUPPORTED TRUE) -set(PAL_TRAIT_PYTHONCOVERAGE_EDITOR_TEST_SUPPORTED TRUE) \ No newline at end of file +set(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED FALSE) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_editor_shared_ios_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_editor_shared_ios_files.cmake deleted file mode 100644 index d21ab15181..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_editor_shared_ios_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for iOS -# i.e. ../Source/iOS/PythonCoverageiOS.cpp -# ../Source/iOS/PythonCoverageiOS.h -# ../Include/iOS/PythonCoverageiOS.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_ios_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_ios_files.cmake deleted file mode 100644 index d21ab15181..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_ios_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for iOS -# i.e. ../Source/iOS/PythonCoverageiOS.cpp -# ../Source/iOS/PythonCoverageiOS.h -# ../Include/iOS/PythonCoverageiOS.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_shared_ios_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_shared_ios_files.cmake deleted file mode 100644 index d21ab15181..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Platform/iOS/pythoncoverage_shared_ios_files.cmake +++ /dev/null @@ -1,8 +0,0 @@ - -# Platform specific files for iOS -# i.e. ../Source/iOS/PythonCoverageiOS.cpp -# ../Source/iOS/PythonCoverageiOS.h -# ../Include/iOS/PythonCoverageiOS.h - -set(FILES -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.cpp b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.cpp index 60c7d8463e..fd3dce4cde 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.cpp +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.cpp @@ -18,9 +18,7 @@ namespace PythonCoverage AZ_CLASS_ALLOCATOR_IMPL(PythonCoverageEditorModule, AZ::SystemAllocator, 0) PythonCoverageEditorModule::PythonCoverageEditorModule() - : PythonCoverageModule() { - // push results of [MyComponent]::CreateDescriptor() into m_descriptors here m_descriptors.insert( m_descriptors.end(), { diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.h b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.h index 669673ec49..180ed79656 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.h +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorModule.h @@ -12,15 +12,17 @@ #pragma once -#include "PythonCoverageModule.h" +#include +#include namespace PythonCoverage { - class PythonCoverageEditorModule : public PythonCoverageModule + class PythonCoverageEditorModule + : public AZ::Module { public: AZ_CLASS_ALLOCATOR_DECL - AZ_RTTI(PythonCoverageEditorModule, "{32C0FFEA-09A7-460F-9257-5BDEF74FCD5B}", PythonCoverageModule); + AZ_RTTI(PythonCoverageEditorModule, "{32C0FFEA-09A7-460F-9257-5BDEF74FCD5B}"); PythonCoverageEditorModule(); ~PythonCoverageEditorModule(); diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp index 26522ebf08..674e8684a5 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp +++ b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageEditorSystemComponent.cpp @@ -37,7 +37,15 @@ namespace PythonCoverage { AzToolsFramework::EditorPythonScriptNotificationsBus::Handler::BusConnect(); AZ::EntitySystemBus::Handler::BusConnect(); + + // Attempt to discover the output directory for the test coverage files ParseCoverageOutputDirectory(); + + if (m_coverageState == CoverageState::Disabled) + { + return; + } + EnumerateAllModuleComponents(); } @@ -49,16 +57,31 @@ namespace PythonCoverage void PythonCoverageEditorSystemComponent::OnEntityActivated(const AZ::EntityId& entityId) { + if (m_coverageState == CoverageState::Disabled) + { + return; + } + EnumerateComponentsForEntity(entityId); - WriteCoverageFile(); + + // There is currently no way to receive a graceful exit signal in order to properly handle the coverage end of life so + // instead we have to serialize the data on-the-fly with blocking disk writes on the main thread... if this adversely + // affects performance in a measurable way then this could potentially be put on a worker thread, although it remains to + // be seen whether the asynchronous nature of such a thread results in queued up coverage being lost due to the hard exit + if (m_coverageState == CoverageState::Gathering) + { + WriteCoverageFile(); + } } void PythonCoverageEditorSystemComponent::ParseCoverageOutputDirectory() { m_coverageState = CoverageState::Disabled; const AZStd::string configFilePath = LY_TEST_IMPACT_DEFAULT_CONFIG_FILE; + if (configFilePath.empty()) { + // Config file path will be empty if test impact analysis framework is disabled AZ_Warning(Caller, false, "No test impact analysis framework config found."); return; } @@ -86,54 +109,50 @@ namespace PythonCoverage return; } - const AZ::IO::Path tempWorkspaceRootDir = configurationFile["workspace"]["temp"]["root"].GetString(); - const AZ::IO::Path artifactRelativeDir = configurationFile["workspace"]["temp"]["relative_paths"]["artifact_dir"].GetString(); + const auto& tempConfig = configurationFile["workspace"]["temp"]; + const AZ::IO::Path tempWorkspaceRootDir = tempConfig["root"].GetString(); + const AZ::IO::Path artifactRelativeDir = tempConfig["relative_paths"]["artifact_dir"].GetString(); m_coverageDir = tempWorkspaceRootDir / artifactRelativeDir; m_coverageState = CoverageState::Idle; } void PythonCoverageEditorSystemComponent::WriteCoverageFile() { - // Yes, we're doing blocking file operations on the main thread... If this becomes an issue this can be offloaded - // to a worker thread - if (m_coverageState == CoverageState::Gathering) + AZStd::string contents; + for (const auto& [testCase, entityComponents] : m_entityComponentMap) { - AZStd::string contents; - for (const auto& [testCase, entityComponents] : m_entityComponentMap) + const auto coveringModules = GetParentComponentModulesForAllActivatedEntities(entityComponents); + if (coveringModules.empty()) { - const auto coveringModules = GetParentComponentModulesForAllActivatedEntities(entityComponents); - if (coveringModules.empty()) - { - return; - } - - contents = testCase + "\n"; - for (const auto& coveringModule : coveringModules) - { - contents += AZStd::string::format(" %s\n", coveringModule.c_str()); - } - } - - AZ::IO::SystemFile file; - const AZStd::vector bytes(contents.begin(), contents.end()); - if (!file.Open( - m_coverageFile.c_str(), - AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY)) - { - AZ_Error( - Caller, false, - "Couldn't open file %s for writing", m_coverageFile.c_str()); return; } - - if (!file.Write(bytes.data(), bytes.size())) + + contents = testCase + "\n"; + for (const auto& coveringModule : coveringModules) { - AZ_Error( - Caller, false, - "Couldn't write contents for file %s", m_coverageFile.c_str()); - return; + contents += AZStd::string::format(" %s\n", coveringModule.c_str()); } } + + AZ::IO::SystemFile file; + const AZStd::vector bytes(contents.begin(), contents.end()); + if (!file.Open( + m_coverageFile.c_str(), + AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY)) + { + AZ_Error( + Caller, false, + "Couldn't open file %s for writing", m_coverageFile.c_str()); + return; + } + + if (!file.Write(bytes.data(), bytes.size())) + { + AZ_Error( + Caller, false, + "Couldn't write contents for file %s", m_coverageFile.c_str()); + return; + } } void PythonCoverageEditorSystemComponent::EnumerateAllModuleComponents() @@ -142,10 +161,9 @@ namespace PythonCoverage &AZ::ModuleManagerRequestBus::Events::EnumerateModules, [this](const AZ::ModuleData& moduleData) { - const AZStd::string moduleName = moduleData.GetDebugName(); + // We can only enumerate shared libs, static libs are invisible to us if (moduleData.GetDynamicModuleHandle()) { - const auto fileName = moduleData.GetDynamicModuleHandle()->GetFilename(); for (const auto* moduleComponentDescriptor : moduleData.GetModule()->GetComponentDescriptors()) { m_moduleComponents[moduleComponentDescriptor->GetUuid()] = moduleData.GetDebugName(); diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageModule.cpp b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageModule.cpp deleted file mode 100644 index 2c56987482..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageModule.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include - -#pragma optimize("", off) - -namespace PythonCoverage -{ - PythonCoverageModule::PythonCoverageModule() - : AZ::Module() - { - // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. - m_descriptors.insert( - m_descriptors.end(), - { PythonCoverageSystemComponent::CreateDescriptor() }); - } - - AZ::ComponentTypeList PythonCoverageModule::GetRequiredSystemComponents() const - { - return AZ::ComponentTypeList{ - azrtti_typeid(), - }; - } -}// namespace PythonCoverage - -#if !defined(PYTHON_COVERAGE_EDITOR) -AZ_DECLARE_MODULE_CLASS(Gem_PythonCoverage, PythonCoverage::PythonCoverageModule) -#endif // !defined(PYTHON_COVERAGE_EDITOR) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageModule.h b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageModule.h deleted file mode 100644 index 4ec6184906..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageModule.h +++ /dev/null @@ -1,26 +0,0 @@ - -#include -#include - -#include - -#pragma once - -#pragma optimize("", off) - -namespace PythonCoverage -{ - class PythonCoverageModule : public AZ::Module - { - public: - AZ_RTTI(PythonCoverageModule, "{dc706de0-22c4-4b05-9b99-438692afc082}", AZ::Module); - AZ_CLASS_ALLOCATOR(PythonCoverageModule, AZ::SystemAllocator, 0); - - PythonCoverageModule(); - - /** - * Add required SystemComponents to the SystemEntity. - */ - AZ::ComponentTypeList GetRequiredSystemComponents() const override; - }; -} // namespace PythonCoverage diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageSystemComponent.cpp b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageSystemComponent.cpp deleted file mode 100644 index 46ffdfdca8..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageSystemComponent.cpp +++ /dev/null @@ -1,70 +0,0 @@ - -#include - -#include -#include -#include - -namespace PythonCoverage -{ - void PythonCoverageSystemComponent::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serialize = azrtti_cast(context)) - { - serialize->Class() - ->Version(0) - ; - - if (AZ::EditContext* ec = serialize->GetEditContext()) - { - ec->Class("PythonCoverage", "[Description of functionality provided by this System Component]") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System")) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ; - } - } - } - - void PythonCoverageSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC("PythonCoverageService")); - } - - void PythonCoverageSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC("PythonCoverageService")); - } - - void PythonCoverageSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - AZ_UNUSED(required); - } - - void PythonCoverageSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) - { - AZ_UNUSED(dependent); - } - - void PythonCoverageSystemComponent::Init() - { - } - - void PythonCoverageSystemComponent::Activate() - { - PythonCoverageRequestBus::Handler::BusConnect(); - AZ::TickBus::Handler::BusConnect(); - } - - void PythonCoverageSystemComponent::Deactivate() - { - AZ::TickBus::Handler::BusDisconnect(); - PythonCoverageRequestBus::Handler::BusDisconnect(); - } - - void PythonCoverageSystemComponent::OnTick(float /*deltaTime*/, AZ::ScriptTimePoint /*time*/) - { - - } - -} // namespace PythonCoverage diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageSystemComponent.h b/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageSystemComponent.h deleted file mode 100644 index 9ca1f60c74..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Source/PythonCoverageSystemComponent.h +++ /dev/null @@ -1,44 +0,0 @@ - -#pragma once - -#include -#include -#include - -namespace PythonCoverage -{ - class PythonCoverageSystemComponent - : public AZ::Component - , protected PythonCoverageRequestBus::Handler - , public AZ::TickBus::Handler - { - public: - AZ_COMPONENT(PythonCoverageSystemComponent, "{b2f692ae-1047-4a6d-a4ed-27b1aac40ba5}"); - - static void Reflect(AZ::ReflectContext* context); - - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); - static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); - - protected: - //////////////////////////////////////////////////////////////////////// - // PythonCoverageRequestBus interface implementation - - //////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////// - // AZTickBus interface implementation - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - //////////////////////////////////////////////////////////////////////// - }; - -} // namespace PythonCoverage diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/Tests/PythonCoverageTest.cpp b/AutomatedTesting/Gem/PythonCoverage/Code/Tests/PythonCoverageTest.cpp deleted file mode 100644 index b1060df364..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/Tests/PythonCoverageTest.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include - -class PythonCoverageTest - : public ::testing::Test -{ -protected: - void SetUp() override - { - - } - - void TearDown() override - { - - } -}; - -TEST_F(PythonCoverageTest, SanityTest) -{ - ASSERT_TRUE(true); -} - -AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_files.cmake index 83fc442299..ffdc071eb8 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_files.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_files.cmake @@ -1,3 +1,13 @@ +# +# 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. +# set(FILES Source/PythonCoverageEditorSystemComponent.cpp diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_shared_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_shared_files.cmake index 33f8f244c6..d1bb21b43e 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_shared_files.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_shared_files.cmake @@ -1,7 +1,15 @@ +# +# 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. +# set(FILES -Source/PythonCoverageModule.cpp -Source/PythonCoverageModule.h -Source/PythonCoverageEditorModule.cpp -Source/PythonCoverageEditorModule.h + Source/PythonCoverageEditorModule.cpp + Source/PythonCoverageEditorModule.h ) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_tests_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_tests_files.cmake index 551b0bf062..f1912e743a 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_tests_files.cmake +++ b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_editor_tests_files.cmake @@ -1,3 +1,13 @@ +# +# 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. +# set(FILES Tests/PythonCoverageEditorTest.cpp diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_files.cmake deleted file mode 100644 index bf6453e4f5..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_files.cmake +++ /dev/null @@ -1,5 +0,0 @@ - -set(FILES - Source/PythonCoverageSystemComponent.cpp - Source/PythonCoverageSystemComponent.h -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_shared_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_shared_files.cmake deleted file mode 100644 index 3e614ee802..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_shared_files.cmake +++ /dev/null @@ -1,5 +0,0 @@ - -set(FILES - Source/PythonCoverageModule.cpp - Source/PythonCoverageModule.h -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_tests_files.cmake b/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_tests_files.cmake deleted file mode 100644 index 55101af371..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Code/pythoncoverage_tests_files.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -set(FILES - Tests/PythonCoverageTest.cpp -) diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Android/android_gem.cmake b/AutomatedTesting/Gem/PythonCoverage/Platform/Android/android_gem.cmake deleted file mode 100644 index 8b13789179..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Android/android_gem.cmake +++ /dev/null @@ -1 +0,0 @@ - diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Android/android_gem.json b/AutomatedTesting/Gem/PythonCoverage/Platform/Android/android_gem.json deleted file mode 100644 index 23bbb28e66..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Android/android_gem.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Tags": ["Android"], -} \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Linux/linux_gem.cmake b/AutomatedTesting/Gem/PythonCoverage/Platform/Linux/linux_gem.cmake deleted file mode 100644 index 8b13789179..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Linux/linux_gem.cmake +++ /dev/null @@ -1 +0,0 @@ - diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Linux/linux_gem.json b/AutomatedTesting/Gem/PythonCoverage/Platform/Linux/linux_gem.json deleted file mode 100644 index d08fbf53ba..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Linux/linux_gem.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Tags": ["Linux"] -} \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Mac/mac_gem.cmake b/AutomatedTesting/Gem/PythonCoverage/Platform/Mac/mac_gem.cmake deleted file mode 100644 index 8b13789179..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Mac/mac_gem.cmake +++ /dev/null @@ -1 +0,0 @@ - diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Mac/mac_gem.json b/AutomatedTesting/Gem/PythonCoverage/Platform/Mac/mac_gem.json deleted file mode 100644 index d42b6f8186..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Mac/mac_gem.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Tags": ["Mac"] -} \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Windows/windows_gem.cmake b/AutomatedTesting/Gem/PythonCoverage/Platform/Windows/windows_gem.cmake deleted file mode 100644 index 8b13789179..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Windows/windows_gem.cmake +++ /dev/null @@ -1 +0,0 @@ - diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/Windows/windows_gem.json b/AutomatedTesting/Gem/PythonCoverage/Platform/Windows/windows_gem.json deleted file mode 100644 index a052f1e05a..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/Windows/windows_gem.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Tags": ["Windows"] -} \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/iOS/ios_gem.cmake b/AutomatedTesting/Gem/PythonCoverage/Platform/iOS/ios_gem.cmake deleted file mode 100644 index 8b13789179..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/iOS/ios_gem.cmake +++ /dev/null @@ -1 +0,0 @@ - diff --git a/AutomatedTesting/Gem/PythonCoverage/Platform/iOS/ios_gem.json b/AutomatedTesting/Gem/PythonCoverage/Platform/iOS/ios_gem.json deleted file mode 100644 index b2dab56d05..0000000000 --- a/AutomatedTesting/Gem/PythonCoverage/Platform/iOS/ios_gem.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Tags": ["iOS"] -} \ No newline at end of file diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorPythonRunnerNotificationBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorPythonRunnerNotificationBus.h new file mode 100644 index 0000000000..ffd161d295 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorPythonRunnerNotificationBus.h @@ -0,0 +1,46 @@ +/* + * 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 + +namespace AzToolsFramework +{ + //! Provides a bus to notify when Python scripts are about to run. + class EditorPythonRunnerNotification + : public AZ::EBusTraits + { + public: + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; + ////////////////////////////////////////////////////////////////////////// + + //! Notifies the execution of a Python script using a string. + virtual void ExecuteByString([[maybe_unused]] AZStd::string_view script) {} + + //! Notifies the execution of a Python script using a filename. + virtual void ExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {} + + //! Notifies the execution of a Python script using a filename and args. + virtual void ExecuteByFilenameWithArgs( + [[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector& args) {} + + //! Notifies the execution of a Python script as a test. + virtual void ExecuteByFilenameAsTest( + [[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector& args) {} + }; + using EditorPythonRunnerNotificationBus = AZ::EBus; + +} // namespace AzToolsFramework + diff --git a/cmake/TestImpactFramework/LYTestImpactFramework.cmake b/cmake/TestImpactFramework/LYTestImpactFramework.cmake index 9789ce187f..bdd580f37e 100644 --- a/cmake/TestImpactFramework/LYTestImpactFramework.cmake +++ b/cmake/TestImpactFramework/LYTestImpactFramework.cmake @@ -18,6 +18,9 @@ option(LY_TEST_IMPACT_INSTRUMENTATION_BIN "Path to test impact framework instrum # Name of test impact framework console static library target set(LY_TEST_IMPACT_CONSOLE_STATIC_TARGET "TestImpact.Frontend.Console.Static") +# Name of test impact framework python coverage gem target +set(LY_TEST_IMPACT_PYTHON_COVERAGE_STATIC_TARGET "PythonCoverage.Editor.Static") + # Name of test impact framework console target set(LY_TEST_IMPACT_CONSOLE_TARGET "TestImpact.Frontend.Console") @@ -395,6 +398,7 @@ function(ly_test_impact_write_config_file CONFIG_TEMPLATE_FILE PERSISTENT_DATA_D # Set the above config file as the default config file to use for the test impact framework console target target_compile_definitions(${LY_TEST_IMPACT_CONSOLE_STATIC_TARGET} PUBLIC "LY_TEST_IMPACT_DEFAULT_CONFIG_FILE=\"${PERSISTENT_DATA_DIR}/$.$.json\"") + target_compile_definitions(${LY_TEST_IMPACT_PYTHON_COVERAGE_STATIC_TARGET} PRIVATE "LY_TEST_IMPACT_DEFAULT_CONFIG_FILE=\"${PERSISTENT_DATA_DIR}/$.$.json\"") message(DEBUG "Test impact framework post steps complete") endfunction()