Add unit test for DebugCommands

This commit is contained in:
Wojtek Figat
2024-10-27 15:22:57 +01:00
parent d88c5f3063
commit 082d97248d
3 changed files with 68 additions and 0 deletions

View File

@@ -177,3 +177,24 @@ public:
return str.Length();
}
};
// Test debug commands via static class.
API_CLASS(Static, Attributes="DebugCommand") class FLAXENGINE_API TestDebugCommand1
{
DECLARE_SCRIPTING_TYPE_NO_SPAWN(TestDebugCommand1);
// Static variable to test.
API_FIELD() static bool Var;
};
// Test debug commands inside a class.
API_CLASS() class FLAXENGINE_API TestDebugCommand2 : public ScriptingObject
{
DECLARE_SCRIPTING_TYPE(TestDebugCommand2);
// Static variable to test.
API_FIELD(Attributes="DebugCommand") static float Var;
// Static method to test.
API_FUNCTION(Attributes="DebugCommand") static void Exec();
};