Add tests for GObject Introspection
Librsvg doesn't yet have tests for GObject Introspection - it just generates the .gir and vapi, but doesn't test that they make sense. Some different types of breakage we have had:
-
#645 (closed) - As part of a reorganization of the sources, moved headers to
include/
, .gir file ended up with<c:include name="include/rsvg.h"/>
which breaks Vala's generated C code. Solution: useinclude/librsvg/*.h
and fiddle with-I$(...)/include
for the librsvg build. - #409 (closed) - Incorrect annotations, visible immediately in incorrect code generated by Vala.
- #454 (closed) - Vala can't deal with struct arguments passed by value and caller-allocated out-parameter (not an annotation issue; Vala bug/limitation?)
- #596 (closed) - bad annotations for a string-like argument.
In general, it would be nice to catch introspection errors before they reach downstream.
A little brainstorming:
- We already require Vala's infrastructure to make the
.vapi
from the.gir
, but a test would really require Vala -> C -> binary compilation - just have parallel API tests for the Vala bindings, that use the uninstalled.vapi
? Will that take care of all static languages? - Dynamic languages will use the
.typelib
and not care about C generation. We already require Python for the GI infrastructure. Do we need a full API test in Python / will that take care of dynamic languages generally?
CC @ricotz @exalm since they have had to deal with Vala breakage before.