From: Tommi Komulainen Date: Wed, 15 Oct 2008 22:18:37 +0000 (+0000) Subject: check that typelib -> gir -> typelib transformation is lossless (it's not) X-Git-Tag: GOBJECT_INTROSPECTION_0_6_0~129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12508a3bbb43422ffcb17457c87c5fdb079be8b2;p=platform%2Fupstream%2Fgobject-introspection.git check that typelib -> gir -> typelib transformation is lossless (it's not) 2008-10-15 Tommi Komulainen * gir/Makefile.am (check-local): check that typelib -> gir -> typelib transformation is lossless (it's not) svn path=/trunk/; revision=720 --- diff --git a/ChangeLog b/ChangeLog index c7fa17e..6f0f525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-10-15 Tommi Komulainen + * gir/Makefile.am (check-local): check that typelib -> gir -> typelib + transformation is lossless (it's not) + +2008-10-15 Tommi Komulainen + * tests/Makefile.am: fix tests to compare xml to xml instead of typelib to xml, and stop on error diff --git a/gir/Makefile.am b/gir/Makefile.am index dbe52a9..be69033 100644 --- a/gir/Makefile.am +++ b/gir/Makefile.am @@ -117,3 +117,24 @@ dist_gir_DATA = $(BUILT_SOURCES) typelibsdir = $(datadir)/girepository typelibs_DATA = GLib-2.0.typelib GModule-2.0.typelib GObject-2.0.typelib Gio-2.0.typelib CLEANFILES += $(typelibs_DATA) + +# Check that typelib -> gir -> typelib transformation is lossless. +# Comparing gir files is relatively fragile (whitespace, attribute default +# values, etc.) but the typelibs should identical as long as the gir files are +# semantically equivalent. + +%.test.gir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT) Makefile + $(DEBUG) $(top_builddir)/tools/g-ir-generate$(EXEEXT) --includedir=. $< -o $@ + +testlib-%: %.test.gir $(top_builddir)/tools/g-ir-generate$(EXEEXT) Makefile + $(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $*.test.typelib + cmp $*.typelib $*.test.typelib && rm $*.test.typelib + +testgir-%: %.test.gir + diff -u $*.gir $< && rm $< + +CLEANFILES += $(typelibs_DATA:%.typelib=%.test.gir) +CLEANFILES += $(typelibs_DATA:%.typelib=%.test.typelib) + +check-local: $(typelibs_DATA:%.typelib=testlib-%) +check-gir: $(typelibs_DATA:%.typelib=testgir-%)