[gobject-introspection] tests: validate GTK-Doc test files
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: validate GTK-Doc test files
- Date: Wed, 9 Oct 2013 16:54:57 +0000 (UTC)
commit d464fb1f18173fea1aa3028cf44002944419b6ee
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date: Wed May 22 07:39:32 2013 +0200
tests: validate GTK-Doc test files
This is more of a handy developer tool than something
that is always expected to be executed as part of the
test suite, so we don't add a hard dependency on xmllint.
https://bugzilla.gnome.org/show_bug.cgi?id=688897
tests/scanner/Makefile.am | 1 +
.../annotationparser/gi/annotation_allow_none.xml | 2 +-
.../annotationparser/gi/annotation_array.xml | 2 +-
.../annotationparser/gi/annotation_closure.xml | 2 +-
.../annotationparser/gi/annotation_constructor.xml | 2 +-
.../annotationparser/gi/annotation_destroy.xml | 2 +-
.../gi/annotation_element_type.xml | 2 +-
.../annotationparser/gi/annotation_foreign.xml | 2 +-
.../gi/annotation_get_value_func.xml | 2 +-
.../scanner/annotationparser/gi/annotation_in.xml | 2 +-
.../annotationparser/gi/annotation_in_out.xml | 2 +-
.../annotationparser/gi/annotation_method.xml | 2 +-
.../scanner/annotationparser/gi/annotation_out.xml | 2 +-
.../annotationparser/gi/annotation_ref_func.xml | 2 +-
.../annotationparser/gi/annotation_rename_to.xml | 2 +-
.../annotationparser/gi/annotation_scope.xml | 2 +-
.../gi/annotation_set_value_func.xml | 2 +-
.../annotationparser/gi/annotation_skip.xml | 2 +-
.../annotationparser/gi/annotation_transfer.xml | 2 +-
.../annotationparser/gi/annotation_type.xml | 2 +-
.../annotationparser/gi/annotation_unref_func.xml | 2 +-
.../annotationparser/gi/annotation_value.xml | 2 +-
.../annotationparser/gi/annotation_virtual.xml | 2 +-
tests/scanner/annotationparser/gi/syntax.xml | 2 +-
.../annotationparser/gi/syntax_identifier.xml | 2 +-
.../annotationparser/gi/syntax_nested_tags.xml | 2 +-
.../gi/syntax_paragraph_breaks.xml | 2 +-
.../scanner/annotationparser/gi/tag_deprecated.xml | 2 +-
.../annotationparser/gi/tag_description.xml | 2 +-
tests/scanner/annotationparser/gi/tag_returns.xml | 8 +-
tests/scanner/annotationparser/gi/tag_since.xml | 2 +-
.../scanner/annotationparser/gi/tag_stability.xml | 2 +-
.../gtkdoc/annotations/tester.c.xml | 2 +-
.../gtkdoc/annotations/tester.h.xml | 2 +-
.../annotationparser/gtkdoc/bugs/tester.c.xml | 2 +-
.../annotationparser/gtkdoc/bugs/tester.h.xml | 2 +-
.../annotationparser/gtkdoc/empty/tester.c.xml | 2 +-
.../annotationparser/gtkdoc/fail/tester.c.xml | 2 +-
.../annotationparser/gtkdoc/fail/tester.h.xml | 2 +-
.../annotationparser/gtkdoc/gobject/giface.c.xml | 2 +-
.../annotationparser/gtkdoc/gobject/giface.h.xml | 2 +-
.../annotationparser/gtkdoc/gobject/gobject.c.xml | 2 +-
.../annotationparser/gtkdoc/gobject/gobject.h.xml | 2 +-
.../annotationparser/gtkdoc/gobject/gtypes.c.xml | 2 +-
.../annotationparser/gtkdoc/gobject/gtypes.h.xml | 2 +-
tests/scanner/annotationparser/test_parser.py | 113 ++++++++-----
tests/scanner/annotationparser/tests.xsd | 171 ++++++++++++++++++++
47 files changed, 289 insertions(+), 90 deletions(-)
---
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index a3069a8..c0a4b12 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -199,6 +199,7 @@ EXTRA_DIST += \
annotationparser/README \
annotationparser/test_parser.py \
annotationparser/test_patterns.py \
+ annotationparser/tests.xsd \
annotationparser/gi/annotation_allow_none.xml \
annotationparser/gi/annotation_array.xml \
annotationparser/gi/annotation_closure.xml \
diff --git a/tests/scanner/annotationparser/gi/annotation_allow_none.xml
b/tests/scanner/annotationparser/gi/annotation_allow_none.xml
index dba0f93..8b8ca3e 100644
--- a/tests/scanner/annotationparser/gi/annotation_allow_none.xml
+++ b/tests/scanner/annotationparser/gi/annotation_allow_none.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_array.xml
b/tests/scanner/annotationparser/gi/annotation_array.xml
index 062c772..a59c267 100644
--- a/tests/scanner/annotationparser/gi/annotation_array.xml
+++ b/tests/scanner/annotationparser/gi/annotation_array.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_closure.xml
b/tests/scanner/annotationparser/gi/annotation_closure.xml
index 83bcdde..cd431f0 100644
--- a/tests/scanner/annotationparser/gi/annotation_closure.xml
+++ b/tests/scanner/annotationparser/gi/annotation_closure.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_constructor.xml
b/tests/scanner/annotationparser/gi/annotation_constructor.xml
index a4cfc46..65ee93d 100644
--- a/tests/scanner/annotationparser/gi/annotation_constructor.xml
+++ b/tests/scanner/annotationparser/gi/annotation_constructor.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_destroy.xml
b/tests/scanner/annotationparser/gi/annotation_destroy.xml
index d322dbb..9fd8a26 100644
--- a/tests/scanner/annotationparser/gi/annotation_destroy.xml
+++ b/tests/scanner/annotationparser/gi/annotation_destroy.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_element_type.xml
b/tests/scanner/annotationparser/gi/annotation_element_type.xml
index 6a87530..30fffaf 100644
--- a/tests/scanner/annotationparser/gi/annotation_element_type.xml
+++ b/tests/scanner/annotationparser/gi/annotation_element_type.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_foreign.xml
b/tests/scanner/annotationparser/gi/annotation_foreign.xml
index 1e6e9f4..2f90ac1 100644
--- a/tests/scanner/annotationparser/gi/annotation_foreign.xml
+++ b/tests/scanner/annotationparser/gi/annotation_foreign.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_get_value_func.xml
b/tests/scanner/annotationparser/gi/annotation_get_value_func.xml
index 70760ea..ab71a7d 100644
--- a/tests/scanner/annotationparser/gi/annotation_get_value_func.xml
+++ b/tests/scanner/annotationparser/gi/annotation_get_value_func.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/annotation_in.xml
b/tests/scanner/annotationparser/gi/annotation_in.xml
index 627f504..4e9be4f 100644
--- a/tests/scanner/annotationparser/gi/annotation_in.xml
+++ b/tests/scanner/annotationparser/gi/annotation_in.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_in_out.xml
b/tests/scanner/annotationparser/gi/annotation_in_out.xml
index f12fffe..cb48957 100644
--- a/tests/scanner/annotationparser/gi/annotation_in_out.xml
+++ b/tests/scanner/annotationparser/gi/annotation_in_out.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_method.xml
b/tests/scanner/annotationparser/gi/annotation_method.xml
index 7fb8192..37c910c 100644
--- a/tests/scanner/annotationparser/gi/annotation_method.xml
+++ b/tests/scanner/annotationparser/gi/annotation_method.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_out.xml
b/tests/scanner/annotationparser/gi/annotation_out.xml
index c548ec8..7b7c1e1 100644
--- a/tests/scanner/annotationparser/gi/annotation_out.xml
+++ b/tests/scanner/annotationparser/gi/annotation_out.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_ref_func.xml
b/tests/scanner/annotationparser/gi/annotation_ref_func.xml
index 91610dc..9d159c1 100644
--- a/tests/scanner/annotationparser/gi/annotation_ref_func.xml
+++ b/tests/scanner/annotationparser/gi/annotation_ref_func.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/annotation_rename_to.xml
b/tests/scanner/annotationparser/gi/annotation_rename_to.xml
index 3d1204d..dc79d18 100644
--- a/tests/scanner/annotationparser/gi/annotation_rename_to.xml
+++ b/tests/scanner/annotationparser/gi/annotation_rename_to.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/annotation_scope.xml
b/tests/scanner/annotationparser/gi/annotation_scope.xml
index e869307..008591d 100644
--- a/tests/scanner/annotationparser/gi/annotation_scope.xml
+++ b/tests/scanner/annotationparser/gi/annotation_scope.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_set_value_func.xml
b/tests/scanner/annotationparser/gi/annotation_set_value_func.xml
index 20f3e26..5418c9c 100644
--- a/tests/scanner/annotationparser/gi/annotation_set_value_func.xml
+++ b/tests/scanner/annotationparser/gi/annotation_set_value_func.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/annotation_skip.xml
b/tests/scanner/annotationparser/gi/annotation_skip.xml
index b6aa3d7..396a495 100644
--- a/tests/scanner/annotationparser/gi/annotation_skip.xml
+++ b/tests/scanner/annotationparser/gi/annotation_skip.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_transfer.xml
b/tests/scanner/annotationparser/gi/annotation_transfer.xml
index 927c492..511f24d 100644
--- a/tests/scanner/annotationparser/gi/annotation_transfer.xml
+++ b/tests/scanner/annotationparser/gi/annotation_transfer.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_type.xml
b/tests/scanner/annotationparser/gi/annotation_type.xml
index 6a8539e..16d4531 100644
--- a/tests/scanner/annotationparser/gi/annotation_type.xml
+++ b/tests/scanner/annotationparser/gi/annotation_type.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/annotation_unref_func.xml
b/tests/scanner/annotationparser/gi/annotation_unref_func.xml
index 6dad3f3..32bd892 100644
--- a/tests/scanner/annotationparser/gi/annotation_unref_func.xml
+++ b/tests/scanner/annotationparser/gi/annotation_unref_func.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/annotation_value.xml
b/tests/scanner/annotationparser/gi/annotation_value.xml
index f111d6b..e7c7d6f 100644
--- a/tests/scanner/annotationparser/gi/annotation_value.xml
+++ b/tests/scanner/annotationparser/gi/annotation_value.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/annotation_virtual.xml
b/tests/scanner/annotationparser/gi/annotation_virtual.xml
index 189d56b..ae8c3be 100644
--- a/tests/scanner/annotationparser/gi/annotation_virtual.xml
+++ b/tests/scanner/annotationparser/gi/annotation_virtual.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/syntax.xml b/tests/scanner/annotationparser/gi/syntax.xml
index 4bbe186..1bb8652 100644
--- a/tests/scanner/annotationparser/gi/syntax.xml
+++ b/tests/scanner/annotationparser/gi/syntax.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/syntax_identifier.xml
b/tests/scanner/annotationparser/gi/syntax_identifier.xml
index 9aae28e..bd7d5c5 100644
--- a/tests/scanner/annotationparser/gi/syntax_identifier.xml
+++ b/tests/scanner/annotationparser/gi/syntax_identifier.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/syntax_nested_tags.xml
b/tests/scanner/annotationparser/gi/syntax_nested_tags.xml
index 00fcabb..b3eaab5 100644
--- a/tests/scanner/annotationparser/gi/syntax_nested_tags.xml
+++ b/tests/scanner/annotationparser/gi/syntax_nested_tags.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/syntax_paragraph_breaks.xml
b/tests/scanner/annotationparser/gi/syntax_paragraph_breaks.xml
index 8861623..3303af4 100644
--- a/tests/scanner/annotationparser/gi/syntax_paragraph_breaks.xml
+++ b/tests/scanner/annotationparser/gi/syntax_paragraph_breaks.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<!--
diff --git a/tests/scanner/annotationparser/gi/tag_deprecated.xml
b/tests/scanner/annotationparser/gi/tag_deprecated.xml
index b43d8a2..abb6b4d 100644
--- a/tests/scanner/annotationparser/gi/tag_deprecated.xml
+++ b/tests/scanner/annotationparser/gi/tag_deprecated.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/tag_description.xml
b/tests/scanner/annotationparser/gi/tag_description.xml
index 1627cd4..f16c9d3 100644
--- a/tests/scanner/annotationparser/gi/tag_description.xml
+++ b/tests/scanner/annotationparser/gi/tag_description.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/tag_returns.xml
b/tests/scanner/annotationparser/gi/tag_returns.xml
index 5506a6f..23c29a7 100644
--- a/tests/scanner/annotationparser/gi/tag_returns.xml
+++ b/tests/scanner/annotationparser/gi/tag_returns.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
@@ -15,13 +15,13 @@
<identifier>
<name>annotation_object_string_out</name>
</identifier>
+ <description>Test returning a string as an out parameter</description>
<tags>
<tag>
<name>returns</name>
<description>some boolean</description>
</tag>
</tags>
- <description>Test returning a string as an out parameter</description>
</docblock>
</parser>
</test>
@@ -42,13 +42,13 @@
<identifier>
<name>annotation_object_string_out</name>
</identifier>
+ <description>Test returning a string as an out parameter</description>
<tags>
<tag>
<name>returns</name>
<description>some boolean</description>
</tag>
</tags>
- <description>Test returning a string as an out parameter</description>
</docblock>
</parser>
</test>
@@ -68,13 +68,13 @@
<identifier>
<name>annotation_object_string_out</name>
</identifier>
+ <description>Test returning a string as an out parameter</description>
<tags>
<tag>
<name>returns</name>
<description>some boolean</description>
</tag>
</tags>
- <description>Test returning a string as an out parameter</description>
</docblock>
</parser>
</test>
diff --git a/tests/scanner/annotationparser/gi/tag_since.xml b/tests/scanner/annotationparser/gi/tag_since.xml
index 15eb7d3..a2dbb89 100644
--- a/tests/scanner/annotationparser/gi/tag_since.xml
+++ b/tests/scanner/annotationparser/gi/tag_since.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gi/tag_stability.xml
b/tests/scanner/annotationparser/gi/tag_stability.xml
index 2f816ab..31862f0 100644
--- a/tests/scanner/annotationparser/gi/tag_stability.xml
+++ b/tests/scanner/annotationparser/gi/tag_stability.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml
b/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml
index c8dd01d..a39b150 100644
--- a/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml
+++ b/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/annotations/tester.h.xml
b/tests/scanner/annotationparser/gtkdoc/annotations/tester.h.xml
index 92b7b2d..6d00aa3 100644
--- a/tests/scanner/annotationparser/gtkdoc/annotations/tester.h.xml
+++ b/tests/scanner/annotationparser/gtkdoc/annotations/tester.h.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/bugs/tester.c.xml
b/tests/scanner/annotationparser/gtkdoc/bugs/tester.c.xml
index dd05970..b8aea1a 100644
--- a/tests/scanner/annotationparser/gtkdoc/bugs/tester.c.xml
+++ b/tests/scanner/annotationparser/gtkdoc/bugs/tester.c.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input><![CDATA[/**
diff --git a/tests/scanner/annotationparser/gtkdoc/bugs/tester.h.xml
b/tests/scanner/annotationparser/gtkdoc/bugs/tester.h.xml
index 4846a53..39fe878 100644
--- a/tests/scanner/annotationparser/gtkdoc/bugs/tester.h.xml
+++ b/tests/scanner/annotationparser/gtkdoc/bugs/tester.h.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/empty/tester.c.xml
b/tests/scanner/annotationparser/gtkdoc/empty/tester.c.xml
index 4dcc994..6419370 100644
--- a/tests/scanner/annotationparser/gtkdoc/empty/tester.c.xml
+++ b/tests/scanner/annotationparser/gtkdoc/empty/tester.c.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input><![CDATA[/**
diff --git a/tests/scanner/annotationparser/gtkdoc/fail/tester.c.xml
b/tests/scanner/annotationparser/gtkdoc/fail/tester.c.xml
index 6e2bb01..f76efdd 100644
--- a/tests/scanner/annotationparser/gtkdoc/fail/tester.c.xml
+++ b/tests/scanner/annotationparser/gtkdoc/fail/tester.c.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/*
diff --git a/tests/scanner/annotationparser/gtkdoc/fail/tester.h.xml
b/tests/scanner/annotationparser/gtkdoc/fail/tester.h.xml
index 0663911..2076e52 100644
--- a/tests/scanner/annotationparser/gtkdoc/fail/tester.h.xml
+++ b/tests/scanner/annotationparser/gtkdoc/fail/tester.h.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml
b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml
index 6511533..65dca48 100644
--- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml
+++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input><![CDATA[/**
diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.h.xml
b/tests/scanner/annotationparser/gtkdoc/gobject/giface.h.xml
index c927153..58c2285 100644
--- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.h.xml
+++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.h.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/gobject.c.xml
b/tests/scanner/annotationparser/gtkdoc/gobject/gobject.c.xml
index ef825d8..1f61940 100644
--- a/tests/scanner/annotationparser/gtkdoc/gobject/gobject.c.xml
+++ b/tests/scanner/annotationparser/gtkdoc/gobject/gobject.c.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input><![CDATA[/**
diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/gobject.h.xml
b/tests/scanner/annotationparser/gtkdoc/gobject/gobject.h.xml
index 4e9f7c8..66627b5 100644
--- a/tests/scanner/annotationparser/gtkdoc/gobject/gobject.h.xml
+++ b/tests/scanner/annotationparser/gtkdoc/gobject/gobject.h.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.c.xml
b/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.c.xml
index eed6943..78f11b2 100644
--- a/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.c.xml
+++ b/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.c.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.h.xml
b/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.h.xml
index d77ec1a..4965adb 100644
--- a/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.h.xml
+++ b/tests/scanner/annotationparser/gtkdoc/gobject/gtypes.h.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<tests>
+<tests xmlns="http://schemas.gnome.org/gobject-introspection/2013/test">
<test>
<input>/**
diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py
index 71b399e..2ebb6c2 100644
--- a/tests/scanner/annotationparser/test_parser.py
+++ b/tests/scanner/annotationparser/test_parser.py
@@ -29,25 +29,51 @@ continues to function correctly.
import difflib
import os
-import xml.etree.ElementTree as etree
+import subprocess
import unittest
+import xml.etree.ElementTree as etree
from giscanner.annotationparser import AnnotationParser
from giscanner.ast import Namespace
from giscanner.message import MessageLogger
+XML_NS = 'http://schemas.gnome.org/gobject-introspection/2013/test'
+XML_SCHEMA = os.path.abspath(os.path.join(os.path.dirname(__file__), 'tests.xsd'))
+XML_LINT = None
+
+
+def ns(x):
+ return x.replace('{}', '{%s}' % (XML_NS, ))
+
+
+def validate(tests_file):
+ global XML_LINT
+
+ try:
+ cmd = ['xmllint', '--noout', '--nonet', '--schema', XML_SCHEMA, tests_file]
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout, stderr = p.communicate()
+ except OSError:
+ if XML_LINT is None:
+ XML_LINT = False
+ print('warning: xmllint not found, validation of test definition files will be skipped')
+ else:
+ if p.returncode != 0:
+ raise SystemExit(stdout)
+
+
class TestCommentBlock(unittest.TestCase):
@classmethod
def __create_test__(cls, testcase):
def do_test(self):
# Parse GTK-Doc comment block
- commentblock = testcase.find('input').text
+ commentblock = testcase.find(ns('{}input')).text
parsed_docblock = AnnotationParser().parse_comment_block((commentblock, 'test.c', 1))
parsed_tree = self.parsed2tree(parsed_docblock).split('\n')
- # Get expected output
- expected_docblock = testcase.find('parser/docblock')
+ # Get expected parser output
+ expected_docblock = testcase.find(ns('{}parser/{}docblock'))
expected_tree = self.expected2tree(expected_docblock).split('\n')
# Construct a meaningful message
@@ -167,86 +193,86 @@ class TestCommentBlock(unittest.TestCase):
if docblock is not None:
expected += '<docblock>\n'
- if docblock.find('identifier') is not None:
+ if docblock.find(ns('{}identifier')) is not None:
expected += ' <identifier>\n'
# Expecting an identifier name is required, don't bother checking if it's there or not
- expected += ' <name>%s</name>\n' % (docblock.find('identifier/name').text, )
- annotations = docblock.find('identifier/annotations')
+ expected += ' <name>%s</name>\n' % (docblock.find(ns('{}identifier/{}name')).text, )
+ annotations = docblock.find(ns('{}identifier/{}annotations'))
if annotations is not None:
expected += ' <annotations>\n'
- for annotation in annotations.findall('annotation'):
+ for annotation in annotations.findall(ns('{}annotation')):
expected += ' <annotation>\n'
- expected += ' <name>%s</name>\n' % (annotation.find('name').text, )
- if annotation.find('options') is not None:
+ expected += ' <name>%s</name>\n' % (annotation.find(ns('{}name')).text, )
+ if annotation.find(ns('{}options')) is not None:
expected += ' <options>\n'
- for option in annotation.findall('options/option'):
+ for option in annotation.findall(ns('{}options/{}option')):
expected += ' <option>\n'
- expected += ' <name>%s</name>\n' % (option.find('name').text, )
+ expected += ' <name>%s</name>\n' %
(option.find(ns('{}name')).text, )
if option.find('value') is not None:
- expected += ' <value>%s</value>\n' %
(option.find('value').text, )
+ expected += ' <value>%s</value>\n' %
(option.find(ns('{}value')).text, )
expected += ' </option>\n'
expected += ' </options>\n'
expected += ' </annotation>\n'
expected += ' </annotations>\n'
expected += ' </identifier>\n'
- parameters = docblock.find('parameters')
+ parameters = docblock.find(ns('{}parameters'))
if parameters is not None:
expected += ' <parameters>\n'
- for parameter in parameters.findall('parameter'):
+ for parameter in parameters.findall(ns('{}parameter')):
expected += ' <parameter>\n'
- expected += ' <name>%s</name>\n' % (parameter.find('name').text, )
- annotations = parameter.find('annotations')
+ expected += ' <name>%s</name>\n' % (parameter.find(ns('{}name')).text, )
+ annotations = parameter.find(ns('{}annotations'))
if annotations is not None:
expected += ' <annotations>\n'
- for annotation in parameter.findall('annotations/annotation'):
+ for annotation in parameter.findall(ns('{}annotations/{}annotation')):
expected += ' <annotation>\n'
- expected += ' <name>%s</name>\n' % (annotation.find('name').text, )
- if annotation.find('options') is not None:
+ expected += ' <name>%s</name>\n' % (annotation.find(ns('{}name')).text,
)
+ if annotation.find(ns('{}options')) is not None:
expected += ' <options>\n'
- for option in annotation.findall('options/option'):
+ for option in annotation.findall(ns('{}options/{}option')):
expected += ' <option>\n'
- expected += ' <name>%s</name>\n' %
(option.find('name').text, )
- if option.find('value') is not None:
- expected += ' <value>%s</value>\n' %
(option.find('value').text, )
+ expected += ' <name>%s</name>\n' %
(option.find(ns('{}name')).text, )
+ if option.find(ns('{}value')) is not None:
+ expected += ' <value>%s</value>\n' %
(option.find(ns('{}value')).text, )
expected += ' </option>\n'
expected += ' </options>\n'
expected += ' </annotation>\n'
expected += ' </annotations>\n'
- if parameter.find('description') is not None:
- expected += ' <description>%s</description>\n' %
(parameter.find('description').text, )
+ if parameter.find(ns('{}description')) is not None:
+ expected += ' <description>%s</description>\n' %
(parameter.find(ns('{}description')).text, )
expected += ' </parameter>\n'
expected += ' </parameters>\n'
- description = docblock.find('description')
+ description = docblock.find(ns('{}description'))
if description is not None:
expected += ' <description>%s</description>\n' % (description.text, )
- tags = docblock.find('tags')
+ tags = docblock.find(ns('{}tags'))
if tags is not None:
expected += ' <tags>\n'
- for tag in tags.findall('tag'):
+ for tag in tags.findall(ns('{}tag')):
expected += ' <tag>\n'
- expected += ' <name>%s</name>\n' % (tag.find('name').text, )
- annotations = tag.find('annotations')
+ expected += ' <name>%s</name>\n' % (tag.find(ns('{}name')).text, )
+ annotations = tag.find(ns('{}annotations'))
if annotations is not None:
expected += ' <annotations>\n'
- for annotation in tag.findall('annotations/annotation'):
+ for annotation in tag.findall(ns('{}annotations/{}annotation')):
expected += ' <annotation>\n'
- expected += ' <name>%s</name>\n' % (annotation.find('name').text, )
- if annotation.find('options') is not None:
+ expected += ' <name>%s</name>\n' % (annotation.find(ns('{}name')).text,
)
+ if annotation.find(ns('{}options')) is not None:
expected += ' <options>\n'
- for option in annotation.findall('options/option'):
+ for option in annotation.findall(ns('{}options/{}option')):
expected += ' <option>\n'
- expected += ' <name>%s</name>\n' %
(option.find('name').text, )
- if option.find('value') is not None:
- expected += ' <value>%s</value>\n' %
(option.find('value').text, )
+ expected += ' <name>%s</name>\n' %
(option.find(ns('{}name')).text, )
+ if option.find(ns('{}value')) is not None:
+ expected += ' <value>%s</value>\n' %
(option.find(ns('{}value')).text, )
expected += ' </option>\n'
expected += ' </options>\n'
expected += ' </annotation>\n'
expected += ' </annotations>\n'
- if tag.find('description') is not None:
- expected += ' <description>%s</description>\n' % (tag.find('description').text,
)
+ if tag.find(ns('{}description')) is not None:
+ expected += ' <description>%s</description>\n' %
(tag.find(ns('{}description')).text, )
expected += ' </tag>\n'
expected += ' </tags>\n'
@@ -261,15 +287,15 @@ def create_tests(tests_dir, tests_file):
tests_tree = etree.parse(tests_file).getroot()
- fix_cdata_elements = tests_tree.findall('test/input')
- fix_cdata_elements += tests_tree.findall('.//description')
+ fix_cdata_elements = tests_tree.findall(ns('{}test/{}input'))
+ fix_cdata_elements += tests_tree.findall(ns('.//{}description'))
for element in fix_cdata_elements:
if element.text:
element.text = element.text.replace('{{?', '<!')
element.text = element.text.replace('}}', '>')
- for counter, test in enumerate(tests_tree.findall('test')):
+ for counter, test in enumerate(tests_tree.findall(ns('{}test'))):
test_name = 'test_%s.%03d' % (tests_name, counter + 1)
test_method = TestCommentBlock.__create_test__(test)
setattr(TestCommentBlock, test_name, test_method)
@@ -290,6 +316,7 @@ if __name__ == '__main__':
for filename in filenames:
tests_file = os.path.join(dirpath, filename)
if os.path.basename(tests_file).endswith('.xml'):
+ validate(tests_file)
create_tests(tests_dir, tests_file)
# Run test suite
diff --git a/tests/scanner/annotationparser/tests.xsd b/tests/scanner/annotationparser/tests.xsd
new file mode 100644
index 0000000..ca47cfe
--- /dev/null
+++ b/tests/scanner/annotationparser/tests.xsd
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://schemas.gnome.org/gobject-introspection/2013/test"
+ targetNamespace="http://schemas.gnome.org/gobject-introspection/2013/test"
+ elementFormDefault="qualified"
+ version="1.0.0">
+
+ <xs:annotation>
+ <xs:documentation><![CDATA[
+ GObject-Introspection - a framework for introspecting GObject libraries
+ Copyright © 2013 Dieter Verfaillie <dieterv optionexplicit be>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.]]>
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:simpleType name="PreservedStringtype">
+ <xs:restriction base="xs:string">
+ <xs:whiteSpace value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="OutputType">
+ <xs:simpleContent>
+ <xs:extension base="t:PreservedStringtype">
+ <xs:attribute name="indent" type="xs:boolean" default="true" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:element name="tests">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="t:test" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="test">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="input" type="t:PreservedStringtype" />
+ <xs:element ref="t:parser" minOccurs="0" />
+ <xs:element name="output" minOccurs="0" type="t:OutputType" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="parser">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="t:docblock" minOccurs="0" />
+ <xs:element ref="t:messages" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="docblock">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="t:identifier" />
+ <xs:element ref="t:parameters" minOccurs="0" />
+ <xs:element name="description" type="t:PreservedStringtype" minOccurs="0" />
+ <xs:element ref="t:tags" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="identifier">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" type="xs:string" />
+ <xs:element ref="t:annotations" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="tags">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="t:tag" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="tag">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" />
+ <xs:element ref="t:annotations" minOccurs="0" />
+ <xs:element name="value" minOccurs="0" />
+ <xs:element name="description" type="t:PreservedStringtype" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="parameters">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="t:parameter" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="parameter">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" />
+ <xs:element ref="t:annotations" minOccurs="0" />
+ <xs:element name="description" type="t:PreservedStringtype" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="annotations">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="t:annotation" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="annotation">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" />
+ <xs:element ref="t:options" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="t:option" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="option">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" />
+ <xs:element name="value" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="messages">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="message" type="t:PreservedStringtype" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]