[gtk-doc] tests: add a minimal test suite we can use for repro cases
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] tests: add a minimal test suite we can use for repro cases
- Date: Sat, 4 Nov 2017 11:28:33 +0000 (UTC)
commit a3a22ca1b6154c5a453b2cb75547469944936ca6
Author: Stefan Sauer <ensonic users sf net>
Date: Sat Nov 4 11:45:57 2017 +0100
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(-)
---
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 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+ <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
+ <!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
+ %gtkdocentities;
+]>
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+ <bookinfo>
+ <title>&package_name; Reference Manual</title>
+ <releaseinfo>
+ for &package_string;.
+ The latest version of this documentation can be found on-line at
+ <ulink role="online-location"
url="http://[SERVER]/&package_name;/index.html">http://[SERVER]/&package_name;/</ulink>.
+ </releaseinfo>
+ </bookinfo>
+
+ <chapter>
+ <title>Tests</title>
+ <xi:include href="xml/tester.xml"/>
+ </chapter>
+
+ <index id="api-index">
+ <title>API Index</title>
+ <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
+ </index>
+</book>
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 <glib.h>
+
+// 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]