Integrating latest 47acbe8

This commit is contained in:
alexpete
2021-03-25 13:57:57 -07:00
parent 448c549698
commit 75dc720198
10312 changed files with 2711566 additions and 671451 deletions
@@ -10,8 +10,6 @@
*
*/
#include <AzCore/Serialization/IdUtils.h>
#include <ScriptCanvas/Asset/RuntimeAsset.h>
#include <ScriptCanvas/Asset/RuntimeAssetHandler.h>
@@ -22,6 +20,10 @@
#include <Source/Framework/ScriptCanvasTestUtilities.h>
#include <Editor/Framework/ScriptCanvasReporter.h>
#if 0
using namespace ScriptCanvasEditor;
#define SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_EXPECT_EQ(LHS, RHS)\
@@ -60,6 +62,19 @@ using namespace ScriptCanvasEditor;
else\
++m_countLEFailed;
#define SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_GT(LHS, RHS)\
if((LHS.IsGreaterThan(RHS))) ++m_countGTSucceeded; else ++m_countGTFailed;
#define SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_GE(LHS, RHS)\
if((LHS.IsGreaterEqualThan(RHS))) ++m_countGESucceeded; else ++m_countGEFailed;
#define SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_LT(LHS, RHS)\
if((LHS.IsLessThan(RHS))) ++m_countLTSucceeded; else ++m_countLTFailed;
#define SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_LE(LHS, RHS)\
if((LHS.IsLessEqualThan(RHS))) ++m_countLTSucceeded; else ++m_countLTFailed;
namespace ScriptCanvas_UnitTestingCPP
{
const double k_tolerance = 0.01;
@@ -152,7 +167,7 @@ bool MetaReporter::operator==(const MetaReporter& other) const
}
// Handler
void MetaReporter::ExpectFalse(const bool value, [[maybe_unused]] const Report& report)
void MetaReporter::ExpectFalse(const bool value, const Report&)
{
if (!value)
++m_countFalseSucceeded;
@@ -160,7 +175,7 @@ void MetaReporter::ExpectFalse(const bool value, [[maybe_unused]] const Report&
++m_countFalseFailed;
}
void MetaReporter::ExpectTrue(const bool value, [[maybe_unused]] const Report& report)
void MetaReporter::ExpectTrue(const bool value, const Report&)
{
if (value)
++m_countTrueSucceeded;
@@ -168,7 +183,7 @@ void MetaReporter::ExpectTrue(const bool value, [[maybe_unused]] const Report& r
++m_countTrueFailed;
}
void MetaReporter::ExpectEqualNumber(const Data::NumberType lhs, const Data::NumberType rhs, [[maybe_unused]] const Report& report)
void MetaReporter::ExpectEqual(const Data::NumberType lhs, const Data::NumberType rhs, const Report&)
{
if (AZ::IsClose(lhs, rhs, ScriptCanvas_UnitTestingCPP::k_tolerance))
++m_countEQSucceeded;
@@ -176,7 +191,7 @@ void MetaReporter::ExpectEqualNumber(const Data::NumberType lhs, const Data::Num
++m_countEQFailed;
}
void MetaReporter::ExpectNotEqualNumber(const Data::NumberType lhs, const Data::NumberType rhs, [[maybe_unused]] const Report& report)
void MetaReporter::ExpectNotEqual(const Data::NumberType lhs, const Data::NumberType rhs, const Report&)
{
if (!AZ::IsClose(lhs, rhs, ScriptCanvas_UnitTestingCPP::k_tolerance))
++m_countNESucceeded;
@@ -196,19 +211,22 @@ SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(MetaReporter, ExpectLes
SCRIPT_CANVAS_UNIT_TEST_COMPARE_OVERLOAD_IMPLEMENTATIONS(MetaReporter, ExpectLessThanEqual, SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_EXPECT_LE)
// Vector Implementations
SCRIPT_CANVAS_UNIT_TEST_VECTOR_COMPARE_OVERLOAD_IMPLEMENTATIONS(MetaReporter, ExpectGreaterThan, SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_GT)
SCRIPT_CANVAS_UNIT_TEST_VECTOR_COMPARE_OVERLOAD_IMPLEMENTATIONS(MetaReporter, ExpectGreaterThanEqual, SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_GE)
SCRIPT_CANVAS_UNIT_TEST_VECTOR_COMPARE_OVERLOAD_IMPLEMENTATIONS(MetaReporter, ExpectLessThan, SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_LT)
SCRIPT_CANVAS_UNIT_TEST_VECTOR_COMPARE_OVERLOAD_IMPLEMENTATIONS(MetaReporter, ExpectLessThanEqual, SCRIPT_CANVAS_UNIT_TEST_META_REPORTER_VECTOR_EXPECT_LE)
MetaReporter MetaRunUnitTestGraph(AZStd::string_view path)
{
const DurationSpec duration;
MetaReporter interpretedReporter;
const AZStd::string filePath = AZStd::string::format("%s/%s.%s", ScriptCanvas_UnitTestingCPP::k_unitTestDirPathRelative, path.data(), ScriptCanvas_UnitTestingCPP::k_defaultExtension);
ScriptCanvasEditor::RunGraph(filePath, ExecutionMode::Interpreted, duration, interpretedReporter);
/*
MetaReporter nativeReporter;
RunGraph(path, ExecutionMode::Native, duration, nativeReporter);
EXPECT_EQ(nativeReporter, interpretedReporter);
*/
RunGraphSpec runGraphSpec;
runGraphSpec.graphPath = filePath;
runGraphSpec.dirPath = ScriptCanvas_UnitTestingCPP::k_unitTestDirPathRelative;
runGraphSpec.runSpec.execution = ExecutionMode::Interpreted;
ScriptCanvasEditor::RunGraphImplementation(runGraphSpec, interpretedReporter);
EXPECT_TRUE(interpretedReporter.IsReportFinished());
return interpretedReporter;
}
@@ -247,7 +265,7 @@ TEST_F(ScriptCanvasTestFixture, AddFailure)
EXPECT_TRUE(reporter.IsComplete());
EXPECT_TRUE(reporter.IsDeactivated());
EXPECT_TRUE(reporter.IsErrorFree());
EXPECT_FALSE(reporter.IsErrorFree());
}
TEST_F(ScriptCanvasTestFixture, AddSuccess)
@@ -472,7 +490,7 @@ TEST_F(ScriptCanvasTestFixture, ExpectGreaterThanEqualSucceed)
EXPECT_TRUE(reporter.IsErrorFree());
}
TEST_F(ScriptCanvasTestFixture, ExpectLessThanFail)
TEST_F(ScriptCanvasTestFixture, ExpectLessThanFail)
{
MetaReporter reporter = MetaRunUnitTestGraph("LY_SC_UnitTest_Meta_ExpectLessThanFail");
@@ -538,4 +556,8 @@ TEST_F(ScriptCanvasTestFixture, ExpectLessThanEqualSucceed)
EXPECT_TRUE(reporter.IsComplete());
EXPECT_TRUE(reporter.IsDeactivated());
EXPECT_TRUE(reporter.IsErrorFree());
}
}
#endif