From a3a22ca1b6154c5a453b2cb75547469944936ca6 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Sat, 4 Nov 2017 11:45:57 +0100 Subject: [PATCH] tests: add a minimal test suite we can use for repro cases --- configure.ac | 21 ++++++----- tests/Makefile.am | 4 +- tests/repro/Makefile.am | 12 ++++++ tests/repro/docs/Makefile.am | 79 ++++++++++++++++++++++++++++++++++++++++ tests/repro/docs/tester-docs.xml | 28 ++++++++++++++ tests/repro/src/Makefile.am | 15 ++++++++ tests/repro/src/tester.c | 8 ++++ tests/repro/src/tester.h | 14 +++++++ 8 files changed, 171 insertions(+), 10 deletions(-) create mode 100644 tests/repro/Makefile.am create mode 100644 tests/repro/docs/Makefile.am create mode 100644 tests/repro/docs/tester-docs.xml create mode 100644 tests/repro/src/Makefile.am create mode 100644 tests/repro/src/tester.c create mode 100644 tests/repro/src/tester.h diff --git a/configure.ac b/configure.ac index ee24f65..2bc110c 100644 --- a/configure.ac +++ b/configure.ac @@ -221,24 +221,27 @@ gtkdoc/config.py help/Makefile help/manual/Makefile tests/Makefile -tests/gobject/Makefile -tests/gobject/src/Makefile -tests/gobject/docs/Makefile -tests/bugs/Makefile -tests/bugs/src/Makefile -tests/bugs/docs/Makefile tests/annotations/Makefile tests/annotations/src/Makefile tests/annotations/docs/Makefile -tests/fail/Makefile -tests/fail/src/Makefile -tests/fail/docs/Makefile +tests/bugs/Makefile +tests/bugs/src/Makefile +tests/bugs/docs/Makefile tests/empty/Makefile tests/empty/src/Makefile tests/empty/docs/Makefile +tests/fail/Makefile +tests/fail/src/Makefile +tests/fail/docs/Makefile +tests/gobject/Makefile +tests/gobject/src/Makefile +tests/gobject/docs/Makefile tests/program/Makefile tests/program/src/Makefile tests/program/docs/Makefile +tests/repro/Makefile +tests/repro/src/Makefile +tests/repro/docs/Makefile ]) dnl run chmod on these after parsing them. diff --git a/tests/Makefile.am b/tests/Makefile.am index 04c5772..429f2f4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,8 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = gobject bugs annotations fail empty program . +# we need to run '.' last so that sanity processes the generated docs +# maybe move it to a subdir? +SUBDIRS = annotations bugs empty fail gobject program repro . if BUILD_TESTS diff --git a/tests/repro/Makefile.am b/tests/repro/Makefile.am new file mode 100644 index 0000000..ad34ec6 --- /dev/null +++ b/tests/repro/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = . src docs + +if BUILD_TESTS + +check-local: clean + +endif + + +-include $(top_srcdir)/git.mk diff --git a/tests/repro/docs/Makefile.am b/tests/repro/docs/Makefile.am new file mode 100644 index 0000000..e8a17fc --- /dev/null +++ b/tests/repro/docs/Makefile.am @@ -0,0 +1,79 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# The name of the module, e.g. 'glib'. +DOC_MODULE=tester + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +DOC_SOURCE_DIR=$(top_srcdir)/tests/repro/src + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +SCAN_OPTIONS=--rebuild-sections --rebuild-types + +# Extra options to supply to gtkdoc-mkdb. +MKDB_OPTIONS=--xml-mode + +# Extra options to supply to gtkdoc-mkhtml +MKHTML_OPTIONS= + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# --html-dir=$(HTML_DIR) +FIXXREF_OPTIONS=--extra-dir=$(glib_prefix)/share/gtk-doc/html + +# Used for dependencies. The docs will be rebuilt if any of these change. +HFILE_GLOB=$(top_srcdir)/tests/repro/src/*.h +CFILE_GLOB=$(top_srcdir)/tests/repro/src/*.c + +# Header files to ignore when scanning. +IGNORE_HFILES=config.h + +# Images to copy into HTML directory. +HTML_IMAGES = + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files = + +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded +# These files must be listed here *and* in content_files +# e.g. expand_content_files=running.sgml +expand_content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +GTKDOC_CFLAGS = -I$(top_srcdir)/tests/repro/src $(TEST_DEPS_CFLAGS) +GTKDOC_LIBS = $(TEST_DEPS_LIBS) $(top_builddir)/tests/repro/src/libtester.la + +# include generic part +include $(top_srcdir)/tests/gtk-doc.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += + +CLEANFILES += \ + $(DOC_MODULE)-overrides.txt \ + $(DOC_MODULE).types + +if BUILD_TESTS +TESTS_ENVIRONMENT = \ + DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ + PATH=$(abs_top_builddir):$(srcdir):$(PATH) \ + PERL5LIB=$(abs_top_builddir):$(PERL5LIB) +endif + +CLEANFILES += \ + tester-sections.txt + +-include $(top_srcdir)/git.mk diff --git a/tests/repro/docs/tester-docs.xml b/tests/repro/docs/tester-docs.xml new file mode 100644 index 0000000..ed97a59 --- /dev/null +++ b/tests/repro/docs/tester-docs.xml @@ -0,0 +1,28 @@ + + + + %gtkdocentities; +]> + + + &package_name; Reference Manual + + for &package_string;. + The latest version of this documentation can be found on-line at + http://[SERVER]/&package_name;/. + + + + + Tests + + + + + API Index + + + diff --git a/tests/repro/src/Makefile.am b/tests/repro/src/Makefile.am new file mode 100644 index 0000000..77f9241 --- /dev/null +++ b/tests/repro/src/Makefile.am @@ -0,0 +1,15 @@ +## Process this file with automake to produce Makefile.in + +if BUILD_TESTS + +noinst_LTLIBRARIES = libtester.la + +libtester_la_SOURCES = tester.c tester.h +#libtester_la_LIBADD = $(TEST_DEPS_LIBS) + +AM_CPPFLAGS = $(TEST_DEPS_CFLAGS) + +endif + + +-include $(top_srcdir)/git.mk diff --git a/tests/repro/src/tester.c b/tests/repro/src/tester.c new file mode 100644 index 0000000..ea5699c --- /dev/null +++ b/tests/repro/src/tester.c @@ -0,0 +1,8 @@ +/** + * SECTION:tester + * @short_description: module for gtk-doc unit test + * + * This is a minimal doc module to serve easy to debug repro cases. + */ + +#include "tester.h" diff --git a/tests/repro/src/tester.h b/tests/repro/src/tester.h new file mode 100644 index 0000000..04fcf20 --- /dev/null +++ b/tests/repro/src/tester.h @@ -0,0 +1,14 @@ +#ifndef GTKDOC_TESTER_H +#define GTKDOC_TESTER_H + +#include + +// FIXME: this should not be needed, if we have a title + long-desc +/** + * FOO: + * + * Placeholder to have non empty docs. + */ +#define FOO 1 + +#endif // GTKDOC_TESTER_H -- 2.11.4.GIT