summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-07-09 08:21:22 -0400
committerXavier Claessens <xavier.claessens@collabora.com>2019-07-17 11:51:15 -0400
commit7aa34874b86e52984770703293e9c7ac40519559 (patch)
tree7746a02837d2bbf65644957fc4ee44a42616c22e /tests
parent803f9982c3258fc4dcda7616e910dc2873d92d9e (diff)
downloadgtk-doc-7aa34874b86e52984770703293e9c7ac40519559.tar.gz
Support type/enum deprecation decorators
GLib recently introduced new kind of deprecation macros, to annotate types and enum values. For example: `typedef _MyType MyType DEPRECATED_FOR(MyOtherType);`
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/docs/Makefile.am2
-rw-r--r--tests/bugs/docs/meson.build2
-rw-r--r--tests/bugs/docs/tester-sections.txt5
-rw-r--r--tests/bugs/src/tester.h47
4 files changed, 54 insertions, 2 deletions
diff --git a/tests/bugs/docs/Makefile.am b/tests/bugs/docs/Makefile.am
index d09c94a..2f33b00 100644
--- a/tests/bugs/docs/Makefile.am
+++ b/tests/bugs/docs/Makefile.am
@@ -19,7 +19,7 @@ SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=--deprecated-guards="GTKDOC_TESTER_DISABLE_DEPRECATED" \
- --ignore-decorators='GLIB_VAR|GTKDOC_GNUC_CONST|BUG_711598_DEPRECATED_FOR()' \
+ --ignore-decorators='GLIB_VAR|GTKDOC_GNUC_CONST|BUG_711598_DEPRECATED_FOR()|MY_DEPRECATED_FOR()' \
--rebuild-types
# Extra options to supply to gtkdoc-mkdb.
diff --git a/tests/bugs/docs/meson.build b/tests/bugs/docs/meson.build
index e39d446..726cf4d 100644
--- a/tests/bugs/docs/meson.build
+++ b/tests/bugs/docs/meson.build
@@ -34,7 +34,7 @@ test(
'--source-dir=@0@'.format(bugs_test_source_dir),
'--ignore-headers=config.h',
'--deprecated-guards=GTKDOC_TESTER_DISABLE_DEPRECATED',
- '--ignore-decorators=GLIB_VAR|GTKDOC_GNUC_CONST|BUG_711598_DEPRECATED_FOR()',
+ '--ignore-decorators=GLIB_VAR|GTKDOC_GNUC_CONST|BUG_711598_DEPRECATED_FOR()|MY_DEPRECATED_FOR()',
'--rebuild-types',
],
)
diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt
index 9e6a5ff..4329e37 100644
--- a/tests/bugs/docs/tester-sections.txt
+++ b/tests/bugs/docs/tester-sections.txt
@@ -12,6 +12,10 @@ Bug512154
Bug644291
Bug000000Scope
Bug76
+MyDeprecatedEnum
+MyNotDeprecatedEnum
+MyDeprecatedStruct
+MyNotDeprecatedStruct
<SUBSECTION Functions>
bug_000000_va1
BUG_000000_VA2
@@ -68,4 +72,5 @@ GLIB_DEPRECATED
BUG_711598_DEPRECATED_FOR
bug_554833_new
G_GNUC_NONNULL
+MY_DEPRECATED_FOR
</SECTION>
diff --git a/tests/bugs/src/tester.h b/tests/bugs/src/tester.h
index 0940e3e..6e05de8 100644
--- a/tests/bugs/src/tester.h
+++ b/tests/bugs/src/tester.h
@@ -432,4 +432,51 @@ struct _Bug76
};
typedef struct _Bug76 Bug76;
+#define MY_DEPRECATED_FOR(val)
+
+/**
+ * MyNotDeprecatedEnum:
+ * @MY_NOT_DEPRECATED_ENUM_VAL1: new value
+ *
+ * some description
+ */
+typedef enum {
+ MY_NOT_DEPRECATED_ENUM_VAL1,
+} MyNotDeprecatedEnum;
+
+/**
+ * MyDeprecatedEnum:
+ * @MY_DEPRECATED_ENUM_VAL1: deprecated, use instead %MY_DEPRECATED_ENUM_VAL2
+ * @MY_DEPRECATED_ENUM_VAL2: val2
+ *
+ * some description
+ * Deprecated: Use #MyNotDeprecatedEnum instead
+ */
+typedef enum {
+ MY_DEPRECATED_ENUM_VAL1 MY_DEPRECATED_FOR(MY_DEPRECATED_ENUM_VAL2),
+ MY_DEPRECATED_ENUM_VAL2,
+} MyDeprecatedEnum MY_DEPRECATED_FOR(MyNotDeprecatedEnum);
+
+/**
+ * MyDeprecatedStruct:
+ *
+ * some description
+ * Deprecated: Use #MyNotDeprecatedStruct instead
+ */
+typedef struct _MyDeprecatedStruct MyDeprecatedStruct MY_DEPRECATED_FOR(MyNotDeprecatedStruct);
+struct _MyDeprecatedStruct {
+ /*< private >*/
+ guint index;
+} MY_DEPRECATED_FOR(MyNotDeprecatedStruct);
+
+/**
+ * MyNotDeprecatedStruct:
+ *
+ * some description
+ */
+typedef struct {
+ /*< private >*/
+ guint index_plop;
+} MyNotDeprecatedStruct;
+
#endif // GTKDOC_TESTER_H