GLibSharp / GtkSharp

.Net bindings for gtk+3 and above
Other
27 stars 21 forks source link

Create generator integration tests and fix generation issues #70

Closed ylatuya closed 1 year ago

ylatuya commented 2 years ago

The bindings generator does already a good job but it still has issues in several areas:

  1. Generated code for some use cases does not compile
  2. Generated code compiles correctly but fails at runtime
  3. There are some memory issues with Opaque's
  4. Generator uses the GAPI format instead of generating code directly from GIR files

The goal is to create a proper test suite with integration and unit tests that will help us fix all of the binding generation issues.

This merge request focuses in creating the initial scaffolding for the test suite and attack the first problem of the generator: all the generated code must compile correctly.

The test suite will use the Regress library from gobject-introspection since it provides a broad coverage of all possible uses cases: https://gitlab.gnome.org/GNOME/gobject-introspection/-/tree/main/tests/scanner

The Regress-1.0.gir is processed with bindinate to generate the GAPI xml that is feed into the code generator.

The test suite will start with 2 integration tests:

Current Status

With this merge request we have gone from:

  1. Not being able to generate any code due to exceptions in the generator
  2. Generated code does not compile with 450 errors and 42 warnings
  3. Create unit tests using the Regress library

To:

  1. Having all code generated and compiling correctly without errors
  2. Fixed several bugs related to array parameters
  3. Have a proper testing infrastructure to work with ease

Next Steps

  1. Create unit test using the Regress library
  2. Fix memory issues with Opaque's
  3. Add support for generating the bindings directly from GIR's
ylatuya commented 2 years ago

I am having issues with the checks not being triggered :(

ylatuya commented 1 year ago

I have added all unit tests missing for the Regress API and integration checks for Gio, Gdk, Gtk, Atk and Pango. This has also been tested with the GStreamer bindings and the update of the bindings went very smoothly, having to fix only one method in the .metadata file. This is now ready to be merged.