summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-01-25 08:54:58 -0600
committerDavid Snopek <dsnopek@gmail.com>2024-05-07 11:08:18 -0500
commita434850069212b2d2dbe70fd82c4e5774b739040 (patch)
treedc624f2af43e2033fb7304e879f5d8348feac7d8 /test
parent54fe2f9891525891a52c47ffbd190d15c38cccab (diff)
downloadredot-cpp-a434850069212b2d2dbe70fd82c4e5774b739040.tar.gz
Allow submitting documentation to the Godot editor
Diffstat (limited to 'test')
-rw-r--r--test/SConstruct4
-rw-r--r--test/doc_classes/Example.xml25
-rw-r--r--test/project/project.godot2
3 files changed, 30 insertions, 1 deletions
diff --git a/test/SConstruct b/test/SConstruct
index 9c25917..7cb25be 100644
--- a/test/SConstruct
+++ b/test/SConstruct
@@ -16,6 +16,10 @@ env = SConscript("../SConstruct")
env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")
+if env["target"] in ["editor", "template_debug"]:
+ doc_data = env.GodotCPPDocData("src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
+ sources.append(doc_data)
+
if env["platform"] == "macos":
library = env.SharedLibrary(
"project/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(
diff --git a/test/doc_classes/Example.xml b/test/doc_classes/Example.xml
new file mode 100644
index 0000000..457709d
--- /dev/null
+++ b/test/doc_classes/Example.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="Example" inherits="Control" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
+ <brief_description>
+ A test control defined in GDExtension.
+ </brief_description>
+ <description>
+ A control used for the automated GDExtension tests.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="simple_func">
+ <return type="void" />
+ <description>
+ Tests a simple function call.
+ </description>
+ </method>
+ </methods>
+ <members>
+ </members>
+ <signals>
+ </signals>
+ <constants>
+ </constants>
+</class>
diff --git a/test/project/project.godot b/test/project/project.godot
index 4f51c07..df3dd70 100644
--- a/test/project/project.godot
+++ b/test/project/project.godot
@@ -12,7 +12,7 @@ config_version=5
config/name="GDExtension Test Project"
run/main_scene="res://main.tscn"
-config/features=PackedStringArray("4.2")
+config/features=PackedStringArray("4.3")
config/icon="res://icon.png"
[native_extensions]