Provisional implementation of PythonCoverage gem

Signed-off-by: John <jonawals@amazon.com>
This commit is contained in:
John
2021-06-21 16:21:47 +01:00
parent cfe4a49136
commit 0e0f266fdd
59 changed files with 1077 additions and 8 deletions
@@ -29,16 +29,22 @@ namespace AzToolsFramework
//////////////////////////////////////////////////////////////////////////
//! executes a Python script using a string, prints the result if printResult is true and script is an expression
virtual void ExecuteByString(AZStd::string_view script, bool printResult) { AZ_UNUSED(script); AZ_UNUSED(printResult); }
virtual void ExecuteByString([[maybe_unused]] AZStd::string_view script, [[maybe_unused]] bool printResult) {}
//! executes a Python script using a filename
virtual void ExecuteByFilename(AZStd::string_view filename) { AZ_UNUSED(filename); }
virtual void ExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {}
//! executes a Python script using a filename and args
virtual void ExecuteByFilenameWithArgs(AZStd::string_view filename, const AZStd::vector<AZStd::string_view>& args) { AZ_UNUSED(filename); AZ_UNUSED(args); }
virtual void ExecuteByFilenameWithArgs(
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
//! executes a Python script as a test
virtual void ExecuteByFilenameAsTest(AZStd::string_view filename, const AZStd::vector<AZStd::string_view>& args) { AZ_UNUSED(filename); AZ_UNUSED(args); }
virtual void ExecuteByFilenameAsTest(
[[maybe_unused]] AZStd::string_view filename,
[[maybe_unused]] AZStd::string_view testCase,
[[maybe_unused]] const AZStd::vector<AZStd::string_view>& args)
{
}
};
using EditorPythonRunnerRequestBus = AZ::EBus<EditorPythonRunnerRequests>;
@@ -0,0 +1,45 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzCore/std/string/string.h>
namespace AzToolsFramework
{
//! Provides a bus to notify when Python scripts are about to run.
class EditorPythonScriptNotifications
: 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 OnExecuteByString([[maybe_unused]] AZStd::string_view script) {}
//! Notifies the execution of a Python script using a filename.
virtual void OnExecuteByFilename([[maybe_unused]] AZStd::string_view filename) {}
//! Notifies the execution of a Python script using a filename and args.
virtual void OnExecuteByFilenameWithArgs(
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
//! Notifies the execution of a Python script as a test.
virtual void OnExecuteByFilenameAsTest(
[[maybe_unused]] AZStd::string_view filename, [[maybe_unused]] AZStd::string_view testCase, [[maybe_unused]] const AZStd::vector<AZStd::string_view>& args) {}
};
using EditorPythonScriptNotificationsBus = AZ::EBus<EditorPythonScriptNotifications>;
}
@@ -41,6 +41,7 @@ set(FILES
API/EditorVegetationRequestsBus.h
API/EditorPythonConsoleBus.h
API/EditorPythonRunnerRequestsBus.h
API/EditorPythonScriptNotificationsBus.h
API/EntityPropertyEditorRequestsBus.h
API/EditorWindowRequestBus.h
API/EntityCompositionRequestBus.h