Commit 86f7acf0 authored by Jasper St. Pierre's avatar Jasper St. Pierre

tests: Use Regress GIR for doctool

This makes us test a lot more functionality in the doc tool, and
removes the need to have a lot of different test libraries, and
different test infrastructure.
parent 841a6cfe

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -106,4 +106,4 @@ docs/reference/version.xml
#g-ir-doc-tool tests
*.page
!tests/doctool/*-expected/*.page
!tests/scanner/*-expected/*.page
......@@ -40,3 +40,9 @@ INTROSPECTION_DOCTOOL = \
UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
$(top_builddir)/g-ir-doc-tool
INTROSPECTION_DOCTOOL_ARGS = \
--add-include-path=$(srcdir) \
--add-include-path=$(top_srcdir)/gir \
--add-include-path=$(builddir) \
--add-include-path=$(top_builddir)
......@@ -318,7 +318,6 @@ tests/offsets/Makefile
tests/scanner/Makefile
tests/repository/Makefile
tests/warn/Makefile
tests/doctool/Makefile
docs/Makefile
docs/reference/Makefile
gobject-introspection-1.0.pc
......
include $(top_srcdir)/common.mk
SUBDIRS = . scanner repository offsets warn
DIST_SUBDIRS = $(SUBDIRS)
if BUILD_DOCTOOL
SUBDIRS += doctool
else
DIST_SUBDIRS += doctool
endif
EXTRA_DIST=
BUILT_SOURCES=
......
include $(top_srcdir)/common.mk
include $(top_srcdir)/Makefile.introspection
INTROSPECTION_SCANNER_ARGS += --warn-all --warn-error -I.
check_LTLIBRARIES = \
libdocexamples.la
AM_CFLAGS = $(GOBJECT_CFLAGS)
LIBS = $(GOBJECT_LIBS)
libdocexamples_la_SOURCES = $(srcdir)/doc-examples-obj.c $(srcdir)/doc-examples-obj.h
GIRS =
TYPELIBS = $(GIRS:.gir=.typelib)
INTROSPECTION_GIRS = $(GIRS)
CHECK_TARGETS = $(GIRS:.gir=-C.page.check) $(GIRS:.gir=-Python.page.check) $(GIRS:.gir=-Gjs.page.check)
MALLARD_DIRS = $(GIRS:.gir=-C) $(GIRS:.gir=-Python) $(GIRS:.gir=-Gjs)
EXPECTED_MALLARD_DIRS = $(MALLARD_DIRS:=-expected)
CLEANFILES = $(TYPELIBS) $(GIRS)
BUILT_SOURCES = $(MALLARD_DIRS)
EXTRA_DIST = $(EXPECTED_MALLARD_DIRS)
DocExamples-1.0.gir: $(top_builddir)/Gio-2.0.gir libdocexamples.la
DocExamples_1_0_gir_LIBS = libdocexamples.la
DocExamples_1_0_gir_INCLUDES = cairo-1.0 Gio-2.0
DocExamples_1_0_gir_FILES = $(libdocexamples_la_SOURCES)
#DocExamples_1_0_gir_SCANNERFLAGS = --c-include="regress.h"
GIRS += DocExamples-1.0.gir
%-C: %.gir
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) $*-C
$(AM_V_at)rm -f $*-C/*.page
$(AM_V_at)$(INTROSPECTION_DOCTOOL) --language C $*.gir -o $*-C/
%-Python: %.gir
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) $*-Python
$(AM_V_at)rm -f $*-Python/*.page
$(AM_V_at)$(INTROSPECTION_DOCTOOL) --language Python $*.gir -o $*-Python/
%-Gjs: %.gir
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) $*-Gjs
$(AM_V_at)rm -f $*-Gjs/*.page
$(AM_V_at)$(INTROSPECTION_DOCTOOL) --language Gjs $*.gir -o $*-Gjs/
%-C.page.check: %-C
@diff -u -w -B -U 10 $(srcdir)/$*-C-expected $*-C && echo " TEST $*-C"
%-Python.page.check: %-Python
@diff -u -w -B -U 10 $(srcdir)/$*-Python-expected $*-Python && echo " TEST $*-Python"
%-Gjs.page.check: %-Gjs
@diff -u -w -B -U 10 $(srcdir)/$*-Gjs-expected $*-Gjs && echo " TEST $*-Gjs"
check-local: $(CHECK_TARGETS) $(TYPELIBS)
clean-local:
@rm -rf $(MALLARD_DIRS)
/* doc-examples-obj.c */
#include "doc-examples-obj.h"
/**
* DocExamplesObj:
*
* This is an example of how to document a class
*
* This class has a signal: #DocExamplesObj::signal-example.
*
* And also has a property: #DocExamplesObj:property-example.
*
* Since: 0.99
*/
G_DEFINE_TYPE (DocExamplesObj, doc_examples_obj, G_TYPE_OBJECT)
static void
doc_examples_obj_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
doc_examples_obj_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
doc_examples_obj_class_init (DocExamplesObjClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GParamSpec *pspec;
gobject_class->get_property = doc_examples_obj_get_property;
gobject_class->set_property = doc_examples_obj_set_property;
/**
* DocExamplesObj::signal-example:
* @obj:
* @int_param: a parameter of type int
* @float_param: a parameter of type float
* @pointer_param: A pointer to @obj's thingy --
* pass @int_param if you really want to.
*
* This is an example of how to document a signal.
*
* Since: 0.99
*/
g_signal_new ("signal-example",
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_POINTER);
/**
* DocExamplesObj:property-example:
*
* This is an example of how to document a property.
*
* Type: GLib.HashTable(utf8,gint8)
* Transfer: container
*
* Since: 0.99
*/
pspec = g_param_spec_boxed ("property-example",
"Example property",
"A contained GHashTable",
G_TYPE_HASH_TABLE,
G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
1,
pspec);
}
static void
doc_examples_obj_init (DocExamplesObj *self)
{
}
DocExamplesObj *
doc_examples_obj_new (void)
{
return g_object_new (DOC_EXAMPLES_TYPE_OBJ, NULL);
}
/**
* doc_examples_obj_method:
* @obj: A #DocExamplesObj.
* @first_arg: first argument
* @second_arg: second argument