Creación del primer test

Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
Somebody Master 2023-02-12 12:49:37 +01:00
parent cfd3252e90
commit 27b1f755f0
Signed by: somebody_master
GPG Key ID: 78315CFDF0B25505
4 changed files with 80 additions and 1 deletions

View File

@ -0,0 +1,48 @@
/* godot-cpp integration testing project.
*
* This is free and unencumbered software released into the public domain.
*/
#include "register_types.h"
#include <gdextension_interface.h>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/core/defs.hpp>
#include <godot_cpp/godot.hpp>
#include "test.h"
using namespace godot;
void initialize_test_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
ClassDB::register_class<Test>();
}
void uninitialize_test_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
}
extern "C" {
// Initialization.
GDExtensionBool GDE_EXPORT
test_library_init(const GDExtensionInterface *p_interface,
GDExtensionClassLibraryPtr p_library,
GDExtensionInitialization *r_initialization) {
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library,
r_initialization);
init_obj.register_initializer(initialize_test_module);
init_obj.register_terminator(uninitialize_test_module);
init_obj.set_minimum_library_initialization_level(
MODULE_INITIALIZATION_LEVEL_SCENE);
return init_obj.init();
}
}

View File

@ -0,0 +1,16 @@
/* godot-cpp integration testing project.
*
* This is free and unencumbered software released into the public domain.
*/
#ifndef EXAMPLE_REGISTER_TYPES_H
#define EXAMPLE_REGISTER_TYPES_H
#include <godot_cpp/core/class_db.hpp>
using namespace godot;
void initialize_test_module(ModuleInitializationLevel p_level);
void uninitialize_test_module(ModuleInitializationLevel p_level);
#endif // EXAMPLE_REGISTER_TYPES_H

View File

@ -1 +1 @@
#include "test.h"
#include "test.h"

View File

@ -0,0 +1,15 @@
#ifndef TEST_H
#define TEST_H
#include <godot_cpp/classes/node3d.hpp>
using namespace godot;
class Test : public Node3D {
GDCLASS(Test, Node3D);
protected:
static void _bind_methods() {}
};
#endif