-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure out how to test the bindings. #10
Comments
Not sure if any types need to be implemented by hand, the ones that are implemented by hand are just there so I had something to work with. |
Some types (math related stuff in particular) benefit from being able to be inlined rather than crossing the C API and dynamic library boundary every time a member is accessed. I agree that some of the other types will be better off just wrapping the C API, though. |
I added in #17 a very primitive testing infrastructure which lets you write a tests like this: godot_test! {
test_foo {
// Test stuff, panic if something is wrong
}
} And a simple godot program in the To run the tests, do:
We should add a script to simplify this and figure out how to run this in the CI (it requires the godot to be installed), but it's a good start. Now let's write some tests. |
Maybe this PR will be of help when running tests on a CI machine (since those usually don't have X11 etc installed) |
Testing on a Windows set-up today. It builds the test library with the filename edit: default resource path renamed #56 |
One thing you could do is to add a test which checks that every class is found in ClassDB, and build all the function tables looking for methods which can't be bound. Another idea would be to build a set of classes in ClassDB. Then subtract all classes we have already in bindings and write that out so you know what is missing from the API. Thanks for the great work so far btw. |
Those are nice ideas, that would probably show a some issues with the bindings that we still didn't encounter yet. 👍 Maybe we should investigate a little more in how testing could be done, the Godot "server" build seems like a good fit for something like that, we'd just need a custom test-harness to make use of that. |
Also important: document findings in https://godot-rust.github.io/book/testing/engine.html |
This has been implemented long ago in CI (Godot integration tests). |
And write some automated tests, especially for types that are reimplemented by hand like math types.
The text was updated successfully, but these errors were encountered: