You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a C# game with an added assembly for game logic. I've added a .NET 6 MSTest project to test game logic. So far so good, tests are running.
But I have a class that assembles geometries by creating Godot ArrayMesh instances. Once ArrayMesh's constructor gets called I get an Access violation error.
Steps to reproduce
The very basic repro is just create a .NET 6 console project, add GodotSharp 4.0.0-beta2 nuget package.
Program.cs:
using Godot;
new ArrayMesh();
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
The C# bindings just call the native C++ implementation so the Godot binary needs to be the entry point or the function pointers won't be available. You should be able to create a Game project that runs the tests though.
Ok, then my question is how should I create a game project that can run MSTest based unit tests? How should I run and debug my tests there? I just created a regular .NET 6 unit test assembly from Visual Studio, and tried to run my tests with VS integrated test runner.
It would just be a normal Godot game project where the main scene runs the tests (e.g.: using the MSTest.TestAdapter package), then you should be able to collect the test results and print them in the console (e.g.: using GD.Print) and then you can exit using SceneTree.Quit which allows you to specify the exit code (0 when tests pass and non-zero when tests fail).
To run the game project from Visual Studio you should be able run and debug it like a normal Godot game project. Unfortunately I don't think there's an easy way to run the tests integrated with the Visual Studio Test Explorer other than maybe implementing your own test adapter but I'm not familiar with how that works.
Godot version
4.0.0-beta2
System information
Windows 10
Issue description
I have a C# game with an added assembly for game logic. I've added a .NET 6 MSTest project to test game logic. So far so good, tests are running.
But I have a class that assembles geometries by creating Godot ArrayMesh instances. Once ArrayMesh's constructor gets called I get an Access violation error.
Steps to reproduce
The very basic repro is just create a .NET 6 console project, add GodotSharp 4.0.0-beta2 nuget package.
Program.cs:
using Godot;
new ArrayMesh();
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: