aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-05-11 09:18:47 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-05-12 15:54:37 -0400
commit4e312c19e693a69b0650ce6c8a8903163c959996 (patch)
tree6f0eee6b0281536078d9b105a4985f504c9b930b /test cases
parent44acefd8365c0ccca428e5ef69153c059aa8e575 (diff)
downloadmeson-4e312c19e693a69b0650ce6c8a8903163c959996.zip
meson-4e312c19e693a69b0650ce6c8a8903163c959996.tar.gz
meson-4e312c19e693a69b0650ce6c8a8903163c959996.tar.bz2
gnome: Fix gtkdoc generation
install_scripts used to replace @BUILD_ROOT@ and @SOURCE_ROOT@ but it was not documented and got removed in Meson 0.58.0. gnome.gtkdoc() was relying on that behaviour, but it has always been broken in the case the source or build directory contains spaces. Fix this by changing get_include_args() to substitue paths directly which will then get escaped correctly. Add a unit test that builds GObject documentation which is where this issue has been spotted. Fixes: #8744
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml2
-rw-r--r--test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-sections.txt16
-rw-r--r--test cases/frameworks/10 gtk-doc/doc/foobar1/foobar.types4
-rw-r--r--test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build6
-rw-r--r--test cases/frameworks/10 gtk-doc/foo.c30
-rw-r--r--test cases/frameworks/10 gtk-doc/include/foo.h18
-rw-r--r--test cases/frameworks/10 gtk-doc/meson.build12
-rw-r--r--test cases/frameworks/10 gtk-doc/test.json4
8 files changed, 88 insertions, 4 deletions
diff --git a/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml b/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml
index 95f73ef..6ccd087 100644
--- a/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml
+++ b/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-docs.sgml
@@ -35,7 +35,7 @@
</partintro>
<xi:include href="xml/foo.xml"/>
<xi:include href="../../include/bar.xml"/>
- <xi:include href="xml/foo-version.xml"/>
+ <xi:include href="xml/version.xml"/>
</reference>
</book>
diff --git a/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-sections.txt b/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-sections.txt
new file mode 100644
index 0000000..d14c8da
--- /dev/null
+++ b/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar-sections.txt
@@ -0,0 +1,16 @@
+<SECTION>
+<FILE>foo</FILE>
+<TITLE>FooObj</TITLE>
+FooObj
+FooObjClass
+foo_do_something
+</SECTION>
+
+<SECTION>
+<FILE>version</FILE>
+<TITLE>version</TITLE>
+FOO_MAJOR_VERSION
+FOO_MINOR_VERSION
+FOO_MICRO_VERSION
+</SECTION>
+
diff --git a/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar.types b/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar.types
new file mode 100644
index 0000000..0a9c046
--- /dev/null
+++ b/test cases/frameworks/10 gtk-doc/doc/foobar1/foobar.types
@@ -0,0 +1,4 @@
+% This include is useless it's a regression test for https://github.com/mesonbuild/meson/issues/8744
+#include <foo.h>
+
+foo_obj_get_type
diff --git a/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build b/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build
index 149c6e9..f4b3724 100644
--- a/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build
+++ b/test cases/frameworks/10 gtk-doc/doc/foobar1/meson.build
@@ -1,5 +1,9 @@
gnome.gtkdoc('foobar',
- src_dir : inc,
+ src_dir : [inc, '.'],
main_sgml : 'foobar-docs.sgml',
content_files : [docbook, version_xml],
+ dependencies: foo_dep,
+ # Manually written types file for regression test:
+ # https://github.com/mesonbuild/meson/issues/8744
+ gobject_typesfile: 'foobar.types',
install : true)
diff --git a/test cases/frameworks/10 gtk-doc/foo.c b/test cases/frameworks/10 gtk-doc/foo.c
new file mode 100644
index 0000000..36c0639
--- /dev/null
+++ b/test cases/frameworks/10 gtk-doc/foo.c
@@ -0,0 +1,30 @@
+#include <foo.h>
+
+
+struct _FooObj {
+ GObject parent;
+ int dummy;
+};
+
+G_DEFINE_TYPE(FooObj, foo_obj, G_TYPE_OBJECT)
+
+static void foo_obj_init (FooObj *self)
+{
+}
+
+static void foo_obj_class_init (FooObjClass *klass)
+{
+}
+
+/**
+ * foo_do_something:
+ * @self: self
+ *
+ * Useless function.
+ *
+ * Returns: 0.
+ */
+int foo_do_something(FooObj *self)
+{
+ return 0;
+}
diff --git a/test cases/frameworks/10 gtk-doc/include/foo.h b/test cases/frameworks/10 gtk-doc/include/foo.h
index 7b8946b..510f3d1 100644
--- a/test cases/frameworks/10 gtk-doc/include/foo.h
+++ b/test cases/frameworks/10 gtk-doc/include/foo.h
@@ -1,5 +1,7 @@
#pragma once
+#include <glib-object.h>
+
/**
* FooIndecision:
* @FOO_MAYBE: Something maybe
@@ -13,3 +15,19 @@ typedef enum {
FOO_POSSIBLY,
} FooIndecision;
+/**
+ * FooObjClass:
+ *
+ * The class
+ */
+
+/**
+ * FooObj:
+ *
+ * The instance
+ */
+
+#define FOO_TYPE_OBJ foo_obj_get_type()
+G_DECLARE_FINAL_TYPE(FooObj, foo_obj, FOO, OBJ, GObject)
+
+int foo_do_something(FooObj *self);
diff --git a/test cases/frameworks/10 gtk-doc/meson.build b/test cases/frameworks/10 gtk-doc/meson.build
index 5c22ad0..292980f 100644
--- a/test cases/frameworks/10 gtk-doc/meson.build
+++ b/test cases/frameworks/10 gtk-doc/meson.build
@@ -24,4 +24,16 @@ if gtkdoc_ver.version_compare('<1.26')
error('MESON_SKIP_TEST gtk-doc test requires gtkdoc >= 1.26.')
endif
+gobject = dependency('gobject-2.0')
+
+libfoo = library('foo', 'foo.c',
+ include_directories: inc,
+ dependencies: gobject,
+)
+
+foo_dep = declare_dependency(
+ link_with: libfoo,
+ include_directories: inc,
+)
+
subdir('doc')
diff --git a/test cases/frameworks/10 gtk-doc/test.json b/test cases/frameworks/10 gtk-doc/test.json
index c44126c..03ad059 100644
--- a/test cases/frameworks/10 gtk-doc/test.json
+++ b/test cases/frameworks/10 gtk-doc/test.json
@@ -4,8 +4,8 @@
{"type": "file", "file": "usr/share/gtk-doc/html/foobar/BAR.html"},
{"type": "file", "file": "usr/share/gtk-doc/html/foobar/foobar.devhelp2"},
{"type": "file", "file": "usr/share/gtk-doc/html/foobar/foobar.html"},
- {"type": "file", "file": "usr/share/gtk-doc/html/foobar/foobar-foo.html"},
- {"type": "file", "file": "usr/share/gtk-doc/html/foobar/foobar-foo-version.html"},
+ {"type": "file", "file": "usr/share/gtk-doc/html/foobar/FooObj.html"},
+ {"type": "file", "file": "usr/share/gtk-doc/html/foobar/foo-version.html"},
{"type": "file", "file": "usr/share/gtk-doc/html/foobar/home.png"},
{"type": "file", "file": "usr/share/gtk-doc/html/foobar/index.html"},
{"type": "file", "file": "usr/share/gtk-doc/html/foobar/left.png"},