summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-07-15 11:57:53 -0500
committerDavid Snopek <dsnopek@gmail.com>2024-08-22 16:31:35 -0500
commit92ace04989bdf8d7d94846f059eeccd723f9b885 (patch)
tree09af7fa975a1aa950dfd8f9018a34c99d80424e7 /test/src
parent62305943a7d756ec8e93babb143dff618ca7adb0 (diff)
downloadredot-cpp-92ace04989bdf8d7d94846f059eeccd723f9b885.tar.gz
Add a test to ensure that library path is absolute
Diffstat (limited to 'test/src')
-rw-r--r--test/src/example.cpp8
-rw-r--r--test/src/example.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp
index a941889..96fe31d 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -248,6 +248,8 @@ void Example::_bind_methods() {
ClassDB::bind_static_method("Example", D_METHOD("test_static", "a", "b"), &Example::test_static);
ClassDB::bind_static_method("Example", D_METHOD("test_static2"), &Example::test_static2);
+ ClassDB::bind_static_method("Example", D_METHOD("test_library_path"), &Example::test_library_path);
+
{
MethodInfo mi;
mi.arguments.push_back(PropertyInfo(Variant::STRING, "some_argument"));
@@ -695,6 +697,12 @@ String Example::test_use_engine_singleton() const {
return OS::get_singleton()->get_name();
}
+String Example::test_library_path() {
+ String library_path;
+ internal::gdextension_interface_get_library_path(internal::library, library_path._native_ptr());
+ return library_path;
+}
+
void ExampleRuntime::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_prop_value", "value"), &ExampleRuntime::set_prop_value);
ClassDB::bind_method(D_METHOD("get_prop_value"), &ExampleRuntime::get_prop_value);
diff --git a/test/src/example.h b/test/src/example.h
index 7f3dfaa..e9bfa95 100644
--- a/test/src/example.h
+++ b/test/src/example.h
@@ -194,6 +194,8 @@ public:
GDVIRTUAL1(_do_something_virtual_with_control, Control *);
String test_use_engine_singleton() const;
+
+ static String test_library_path();
};
VARIANT_ENUM_CAST(Example::Constants);