gobject-introspection: add option to run tests

cf. #22314.