Tests: Convert test headers to compilation files

• Excludes module tests, as they'd be a more involved process
This commit is contained in:
Thaddeus Crews 2025-10-25 14:58:45 -05:00
parent ad4c2c3da8
commit 5482b9e89e
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
162 changed files with 1035 additions and 833 deletions

View file

@ -30,6 +30,7 @@
#pragma once
#include "core/os/memory.h"
#include "core/templates/span.h"
GODOT_GCC_WARNING_PUSH_AND_IGNORE("-Warray-bounds")

View file

@ -3,7 +3,7 @@
deadlock:modules/text_server_adv/text_server_adv.cpp
deadlock:modules/text_server_fb/text_server_fb.cpp
deadlock:tests/core/templates/test_command_queue.h
deadlock:tests/core/templates/test_command_queue.cpp
race:modules/navigation_2d/nav_map_2d.cpp
race:modules/navigation_3d/nav_map_3d.cpp
race:thirdparty/thorvg/src/loaders/external_jpg/tvgJpgLoader.cpp

View file

@ -34,8 +34,8 @@
#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/image.h"
#include "tests/core/config/test_project_settings.h"
#include "tests/test_macros.h"
#include "tests/test_utils.h"

View file

@ -34,6 +34,8 @@
#ifdef TOOLS_ENABLED
#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
#include "core/os/os.h"
#include "drivers/png/image_loader_png.h"
#include "editor/import/3d/resource_importer_scene.h"
@ -46,7 +48,7 @@
#include "scene/resources/compressed_texture.h"
#include "scene/resources/material.h"
#include "scene/resources/packed_scene.h"
#include "tests/core/config/test_project_settings.h"
#include "tests/test_utils.h"
#include "modules/gltf/editor/editor_scene_importer_gltf.h"
#include "modules/gltf/gltf_document.h"

View file

@ -390,6 +390,25 @@ def generate_scu_files(max_includes_per_scu):
process_folder(["servers/navigation_3d"])
process_folder(["servers/xr"])
# NOTE: Tests previously compiled as one large unit. We replicate this behavior in SCU builds.
process_folder([
"tests",
"/core",
"/core/config",
"/core/input",
"/core/io",
"/core/math",
"/core/object",
"/core/os",
"/core/string",
"/core/templates",
"/core/threads",
"/core/variant",
"/scene",
"/servers",
"/servers/rendering",
])
# Finally change back the path to the calling folder
os.chdir(curr_folder)

View file

@ -1,9 +1,11 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *
Import("env")
import glob
env.tests_sources = []
import test_builders
Import("env")
env_tests = env.Clone()
@ -17,7 +19,19 @@ if env_tests["platform"] == "windows":
if env["disable_exceptions"]:
env_tests.Append(CPPDEFINES=["DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS"])
env_tests.add_source_files(env.tests_sources, "*.cpp")
# Sources with tests must be explicitly linked first.
force_link_sources = glob.glob("*/**/*.cpp", recursive=True)
force_link_header = env.CommandNoCache(
"force_link.gen.h", env_tests.Value(force_link_sources), env.Run(test_builders.force_link_builder)
)
env.Depends(force_link_header, "test_builders.py")
lib = env_tests.add_library("tests", env.tests_sources)
tests_obj = []
if env["scu_build"]:
# HACK: SCU setup doesn't support recursive/dynamic setup, so we must manually pass the files.
env_tests.add_source_files(tests_obj, glob.glob(".scu/*.cpp"))
else:
env_tests.add_source_files(tests_obj, glob.glob("*.cpp") + force_link_sources)
lib = env_tests.add_library("tests", tests_obj)
env.Prepend(LIBS=[lib])

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_project_settings.h */
/* test_project_settings.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,19 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_project_settings)
#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
#include "core/variant/variant.h"
#include "tests/test_macros.h"
class TestProjectSettingsInternalsAccessor {
public:
static String &resource_path() {
return ProjectSettings::get_singleton()->resource_path;
}
};
#include "tests/test_utils.h"
namespace TestProjectSettings {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_input_event.h */
/* test_input_event.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,16 +28,17 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_input_event)
#include "core/input/input_event.h"
#include "core/math/rect2.h"
#include "core/os/memory.h"
#include "core/variant/array.h"
#include "tests/test_macros.h"
namespace TestInputEvent {
TEST_CASE("[InputEvent] Signal is emitted when device is changed") {
Ref<InputEventKey> input_event;
input_event.instantiate();
@ -107,4 +108,5 @@ TEST_CASE("[InputEvent] Test xformed_by") {
CHECK(iemm2->get_position().is_equal_approx(Vector2(2.0f, 3.0f)));
}
} // namespace TestInputEvent

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_input_event_key.h */
/* test_input_event_key.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_input_event_key)
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "tests/test_macros.h"
namespace TestInputEventKey {
TEST_CASE("[InputEventKey] Key correctly registers being pressed") {
@ -372,4 +372,5 @@ TEST_CASE("[IsMatch] Keys are correctly matched") {
key3.set_keycode(Key::SHIFT);
CHECK(key3.is_match(loc_ref, false) == true);
}
} // namespace TestInputEventKey

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_input_event_mouse.h */
/* test_input_event_mouse.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_input_event_mouse)
#include "core/input/input_event.h"
#include "tests/test_macros.h"
namespace TestInputEventMouse {
@ -75,4 +76,5 @@ TEST_CASE("[InputEventMouse] Setting the global mouse position works correctly")
CHECK(mousekey.get_global_position() == Vector2{ -1, -1 });
CHECK(mousekey.get_global_position() != Vector2{ 1, 1 });
}
} // namespace TestInputEventMouse

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_shortcut.h */
/* test_shortcut.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_shortcut)
#include "core/input/input_event.h"
#include "core/input/shortcut.h"
@ -37,8 +39,6 @@
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "tests/test_macros.h"
namespace TestShortcut {
TEST_CASE("[Shortcut] Empty shortcut should have no valid events and text equal to None") {
@ -215,4 +215,5 @@ TEST_CASE("[Shortcut] Equal arrays should be recognized as such.") {
CHECK(s.is_event_array_equal(same, different2) == false);
CHECK(s.is_event_array_equal(same, different3) == false);
}
} // namespace TestShortcut

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_config_file.h */
/* test_config_file.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_config_file)
#include "core/io/config_file.h"
#include "core/os/os.h"
#include "tests/test_macros.h"
namespace TestConfigFile {
TEST_CASE("[ConfigFile] Parsing well-formatted files") {
@ -158,4 +158,5 @@ antiAliasing=false
CHECK_MESSAGE(file->get_as_utf8_string() == contents,
"The saved configuration file should match the expected format.");
}
} // namespace TestConfigFile

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_file_access.h */
/* test_file_access.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "core/io/file_access.h"
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_file_access)
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "tests/test_utils.h"
namespace TestFileAccess {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_http_client.h */
/* test_http_client.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_http_client)
#include "core/io/http_client.h"
#include "tests/test_macros.h"
#include "modules/modules_enabled.gen.h"
#ifdef WEB_ENABLED
#include "modules/modules_enabled.gen.h" // For mbedtls.
#endif // WEB_ENABLED
namespace TestHTTPClient {
@ -88,7 +90,7 @@ TEST_CASE("[HTTPClient] verify_headers") {
ERR_PRINT_ON;
}
#if defined(MODULE_MBEDTLS_ENABLED) || defined(WEB_ENABLED)
#ifdef MODULE_MBEDTLS_ENABLED
TEST_CASE("[HTTPClient] connect_to_host") {
Ref<HTTPClient> client = HTTPClient::create();
String host = "https://www.example.com";
@ -99,6 +101,6 @@ TEST_CASE("[HTTPClient] connect_to_host") {
Error err = client->connect_to_host(host, port, tls_options);
CHECK_MESSAGE(err == OK, "Expected OK for successful connection");
}
#endif // MODULE_MBEDTLS_ENABLED || WEB_ENABLED
#endif // MODULE_MBEDTLS_ENABLED
} // namespace TestHTTPClient

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_image.h */
/* test_image.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,16 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_image)
#include "core/io/file_access.h"
#include "core/io/image.h"
#include "core/os/os.h"
#include "tests/test_utils.h"
#include "modules/modules_enabled.gen.h"
#include "thirdparty/doctest/doctest.h"
#include "modules/modules_enabled.gen.h" // For bmp, jpg, svg, webp, tga.
namespace TestImage {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_ip.h */
/* test_ip.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_ip)
#include "core/io/ip.h"
#include "tests/test_macros.h"
namespace TestIP {
TEST_CASE("[IP] resolve_hostname") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_ip_address.h */
/* test_ip_address.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_ip_address)
#include "core/io/ip_address.h"
#include "tests/test_macros.h"
namespace TestIPAddress {
struct IPTester : public IPAddress {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_json.h */
/* test_json.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_json)
#include "core/io/json.h"
#include "thirdparty/doctest/doctest.h"
namespace TestJSON {
TEST_CASE("[JSON] Stringify single data types") {
@ -423,4 +423,5 @@ TEST_CASE("[JSON] Serialization") {
}
}
}
} // namespace TestJSON

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_json_native.h */
/* test_json_native.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_json_native)
#include "core/io/json.h"
#include "core/variant/typed_array.h"
#include "core/variant/typed_dictionary.h"
#include "tests/test_macros.h"
namespace TestJSONNative {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_logger.h */
/* test_logger.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "core/io/dir_access.h"
#include "core/io/logger.h"
#include "modules/regex/regex.h"
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_logger)
#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/logger.h"
namespace TestLogger {
constexpr int sleep_duration = 1200000;

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_marshalls.h */
/* test_marshalls.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_marshalls)
#include "core/io/marshalls.h"
#include "tests/test_macros.h"
namespace TestMarshalls {
TEST_CASE("[Marshalls] Unsigned 16 bit integer encoding") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_packet_peer.h */
/* test_packet_peer.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_packet_peer)
#include "core/io/packet_peer.h"
#include "tests/test_macros.h"
namespace TestPacketPeer {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_pck_packer.h */
/* test_pck_packer.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_pck_packer)
#include "core/io/file_access_pack.h"
#include "core/io/pck_packer.h"
#include "core/os/os.h"
#include "tests/test_utils.h"
#include "thirdparty/doctest/doctest.h"
namespace TestPCKPacker {
@ -119,4 +119,5 @@ TEST_CASE("[PCKPacker] Pack a PCK file with some files and directories") {
f->get_length() <= 27000,
"The generated non-empty PCK file shouldn't be too large.");
}
} // namespace TestPCKPacker

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_resource.h */
/* test_resource.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,16 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_resource)
#include "core/io/resource.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "scene/main/node.h"
#include "thirdparty/doctest/doctest.h"
#include "tests/test_macros.h"
#include "tests/test_utils.h"
#include <functional>
@ -627,4 +626,5 @@ TEST_CASE("[Resource] Breaking circular references on save") {
// Break circular reference to avoid memory leak
resource_c->remove_meta("next");
}
} // namespace TestResource

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_resource_uid.h */
/* test_resource_uid.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_resource_uid)
#include "core/io/resource_uid.h"
#include "thirdparty/doctest/doctest.h"
#include "tests/test_macros.h"
namespace TestResourceUID {
TEST_CASE("[ResourceUID] Must encode/decode maximum/minimum UID correctly") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_stream_peer.h */
/* test_stream_peer.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_stream_peer)
#include "core/io/stream_peer.h"
#include "tests/test_macros.h"
namespace TestStreamPeer {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_stream_peer_buffer.h */
/* test_stream_peer_buffer.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_stream_peer_buffer)
#include "core/io/stream_peer.h"
#include "tests/test_macros.h"
namespace TestStreamPeerBuffer {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_stream_peer_gzip.h */
/* test_stream_peer_gzip.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "core/io/stream_peer_gzip.h"
#include "tests/test_macros.h"
namespace TestStreamPeerGZIP {
TEST_FORCE_LINK(test_stream_peer_gzip)
#include "core/io/stream_peer_gzip.h"
namespace TestStreamGZIP {
const String hello = "Hello World!!!";
@ -192,4 +193,4 @@ TEST_CASE("[StreamPeerGZIP] Fails to get if nothing was compress/decompress") {
ERR_PRINT_ON;
}
} // namespace TestStreamPeerGZIP
} // namespace TestStreamGZIP

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_stream_peer_tcp.h */
/* test_stream_peer_tcp.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_stream_peer_tcp)
#include "core/io/net_socket.h"
#include "core/io/stream_peer_tcp.h"
#include "tests/test_macros.h"
namespace TestStreamPeerTCP {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_tcp_server.h */
/* test_tcp_server.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_tcp_server)
#include "core/config/project_settings.h"
#include "core/io/stream_peer_tcp.h"
#include "core/io/tcp_server.h"
#include "tests/test_macros.h"
#include <functional>

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_udp_server.h */
/* test_udp_server.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_udp_server)
#include "core/io/packet_peer_udp.h"
#include "core/io/udp_server.h"
#include "tests/test_macros.h"
#include <functional>
namespace TestUDPServer {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_uds_server.h */
/* test_uds_server.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,19 +28,21 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_uds_server)
#ifdef UNIX_ENABLED
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/stream_peer_uds.h"
#include "core/io/uds_server.h"
#include "tests/test_macros.h"
#include <functional>
namespace TestUDSServer {
#ifdef UNIX_ENABLED
const String SOCKET_PATH = "/tmp/godot_test_uds_socket";
const uint32_t SLEEP_DURATION = 1000;
const uint64_t MAX_WAIT_USEC = 2000000;
@ -297,6 +299,6 @@ TEST_CASE("[UDSServer] Test with different socket paths") {
}
}
#endif
} // namespace TestUDSServer
#endif // UNIX_ENABLED

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_xml_parser.h */
/* test_xml_parser.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_xml_parser)
#include "core/io/xml_parser.h"
#include "tests/test_macros.h"
namespace TestXMLParser {
TEST_CASE("[XMLParser] End-to-end") {
String source = "<?xml version = \"1.0\" encoding=\"UTF-8\" ?>\
<top attr=\"attr value\">\
@ -229,4 +230,5 @@ TEST_CASE("[XMLParser] CDATA") {
CHECK_EQ(parser.get_node_type(), XMLParser::NodeType::NODE_ELEMENT_END);
CHECK_EQ(parser.get_node_name(), "a");
}
} // namespace TestXMLParser

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_aabb.h */
/* test_aabb.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_aabb)
#include "core/math/aabb.h"
#include "tests/test_macros.h"
namespace TestAABB {
TEST_CASE("[AABB] Constructor methods") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_astar.h */
/* test_astar.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_astar)
#include "core/math/a_star.h"
#include "tests/test_macros.h"
namespace TestAStar {
class ABCX : public AStar3D {
@ -233,4 +233,5 @@ TEST_CASE("[AStar3D] Path from disabled point is empty") {
CHECK(a.get_point_path(1, 1).is_empty());
CHECK(a.get_point_path(1, 2).is_empty());
}
} // namespace TestAStar

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_basis.h */
/* test_basis.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_basis)
#include "core/math/basis.h"
#include "core/math/random_number_generator.h"
#include "tests/test_macros.h"
namespace TestBasis {
Vector3 deg_to_rad(const Vector3 &p_rotation) {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_color.h */
/* test_color.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_color)
#include "core/math/color.h"
#include "tests/test_macros.h"
namespace TestColor {
TEST_CASE("[Color] Constructor methods") {
@ -225,4 +225,5 @@ TEST_CASE("[Color] Manipulation methods") {
red.lerp(yellow, 0.5).is_equal_approx(Color(1, 0.5, 0, 0.5)),
"Red interpolated with yellow should be orange (with interpolated alpha).");
}
} // namespace TestColor

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_expression.h */
/* test_expression.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_expression)
#include "core/math/expression.h"
#include "tests/test_macros.h"
namespace TestExpression {
TEST_CASE("[Expression] Integer arithmetic") {
@ -487,4 +487,5 @@ TEST_CASE("[Expression] Unusual expressions") {
// int64_t(expression.execute()) == 0,
// "`(-9223372036854775807 - 1) / -1` should return the expected result.");
}
} // namespace TestExpression

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_geometry_2d.h */
/* test_geometry_2d.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_geometry_2d)
#include "core/math/geometry_2d.h"
#include "thirdparty/doctest/doctest.h"
namespace TestGeometry2D {
TEST_CASE("[Geometry2D] Point in circle") {
@ -889,4 +889,5 @@ TEST_CASE("[Geometry2D] Bresenham line") {
CHECK(r[11] == Vector2i(11, 5));
}
}
} // namespace TestGeometry2D

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_geometry_3d.h */
/* test_geometry_3d.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "core/math/geometry_3d.h"
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_geometry_3d)
#include "core/math/geometry_3d.h"
namespace TestGeometry3D {
TEST_CASE("[Geometry3D] Closest Points Between Segments") {
Vector3 ps, qt;
Geometry3D::get_closest_points_between_segments(Vector3(1, -1, 1), Vector3(1, 1, -1), Vector3(-1, -2, -1), Vector3(-1, 1, 1), ps, qt);
@ -199,4 +201,5 @@ TEST_CASE("[Geometry3D] Triangle and Sphere Intersect") {
CHECK(Geometry3D::triangle_sphere_intersection_test(triangle_a, triangle_b, triangle_c, Vector3(0, 1, 0), Vector3(0, 0, 0), 5, triangle_contact, sphere_contact) == true);
CHECK(Geometry3D::triangle_sphere_intersection_test(triangle_a, triangle_b, triangle_c, Vector3(0, 1, 0), Vector3(20, 0, 0), 5, triangle_contact, sphere_contact) == false);
}
} // namespace TestGeometry3D

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_math_funcs.h */
/* test_math_funcs.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
namespace TestMath {
TEST_FORCE_LINK(test_math_funcs)
namespace TestMathFuncs {
TEST_CASE("[Math] C++ macros") {
CHECK(MIN(-2, 2) == -2);
@ -638,4 +638,4 @@ TEST_CASE_TEMPLATE("[Math] bezier_interpolate", T, float, double) {
CHECK(Math::bezier_interpolate((T)0.0, (T)0.2, (T)0.8, (T)1.0, (T)1.0) == doctest::Approx((T)1.0));
}
} // namespace TestMath
} // namespace TestMathFuncs

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_plane.h */
/* test_plane.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,16 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_plane)
#include "core/math/plane.h"
#include "thirdparty/doctest/doctest.h"
namespace TestPlane {
// Plane
TEST_CASE("[Plane] Constructor methods") {
constexpr Plane plane = Plane(32, 22, 16, 3);
constexpr Plane plane_vector = Plane(Vector3(32, 22, 16), 3);

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_projection.h */
/* test_projection.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_projection)
#include "core/math/aabb.h"
#include "core/math/plane.h"
@ -36,8 +38,6 @@
#include "core/math/rect2.h"
#include "core/math/transform_3d.h"
#include "thirdparty/doctest/doctest.h"
namespace TestProjection {
TEST_CASE("[Projection] Construction") {
@ -691,4 +691,5 @@ TEST_CASE("[Projection] Pixels per meter") {
ppm = proj.get_pixels_per_meter(800);
CHECK(ppm == 400);
}
} //namespace TestProjection
} // namespace TestProjection

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_quaternion.h */
/* test_quaternion.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,15 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_quaternion)
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/quaternion.h"
#include "core/math/vector3.h"
#include "tests/test_macros.h"
namespace TestQuaternion {
Quaternion quat_euler_yxz_deg(Vector3 angle) {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_random_number_generator.h */
/* test_random_number_generator.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_random_number_generator)
#include "core/math/random_number_generator.h"
#include "tests/test_macros.h"
namespace TestRandomNumberGenerator {
@ -269,4 +270,5 @@ TEST_CASE_MAY_FAIL("[RandomNumberGenerator] randi_range bias check") {
CHECK_MESSAGE(std::abs(vals[i] / 1000000.0 - 0.1) < 0.01, "Each element should appear roughly 10% of the time");
}
}
} // namespace TestRandomNumberGenerator

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_rect2.h */
/* test_rect2.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_rect2)
#include "core/math/rect2.h"
#include "core/math/rect2i.h"
#include "thirdparty/doctest/doctest.h"
namespace TestRect2 {
TEST_CASE("[Rect2] Constructor methods") {
constexpr Rect2 rect = Rect2(0, 100, 1280, 720);
constexpr Rect2 rect_vector = Rect2(Vector2(0, 100), Vector2(1280, 720));

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_rect2i.h */
/* test_rect2i.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_rect2i)
#include "core/math/rect2.h"
#include "core/math/rect2i.h"
#include "thirdparty/doctest/doctest.h"
namespace TestRect2i {
TEST_CASE("[Rect2i] Constructor methods") {
constexpr Rect2i recti = Rect2i(0, 100, 1280, 720);
constexpr Rect2i recti_vector = Rect2i(Vector2i(0, 100), Vector2i(1280, 720));
@ -305,4 +306,5 @@ TEST_CASE("[Rect2i] Merging") {
Rect2i(0, 100, 1280, 720).merge(Rect2i(-4000, -4000, 100, 100)) == Rect2i(-4000, -4000, 5280, 4820),
"merge() with non-enclosed Rect2i should return the expected result.");
}
} // namespace TestRect2i

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_transform_2d.h */
/* test_transform_2d.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_transform_2d)
#include "core/math/transform_2d.h"
#include "tests/test_macros.h"
namespace TestTransform2D {
Transform2D create_dummy_transform() {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_transform_3d.h */
/* test_transform_3d.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_transform_3d)
#include "core/math/transform_3d.h"
#include "tests/test_macros.h"
namespace TestTransform3D {
Transform3D create_dummy_transform() {
@ -135,4 +135,5 @@ TEST_CASE("[Transform3D] Rotate in-place (local rotation)") {
const Transform3D rotated_transform = Transform3D(transform.rotated_local(Vector3(0, 1, 0), Math::PI));
CHECK_MESSAGE(rotated_transform.is_equal_approx(expected), "The rotated transform should have a new orientation but still be based on the same origin.");
}
} // namespace TestTransform3D

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_triangle_mesh.h */
/* test_triangle_mesh.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_triangle_mesh)
#ifndef _3D_DISABLED
#include "core/math/triangle_mesh.h"
#include "scene/resources/3d/primitive_meshes.h"
#include "tests/test_macros.h"
namespace TestTriangleMesh {
TEST_CASE("[SceneTree][TriangleMesh] BVH creation and intersection") {
@ -79,4 +81,7 @@ TEST_CASE("[SceneTree][TriangleMesh] BVH creation and intersection") {
CHECK(face_index == 8);
}
}
} // namespace TestTriangleMesh
#endif // _3D_DISABLED

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vector2.h */
/* test_vector2.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vector2)
#include "core/math/vector2.h"
#include "core/math/vector2i.h"
#include "tests/test_macros.h"
namespace TestVector2 {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vector2i.h */
/* test_vector2i.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vector2i)
#include "core/math/vector2.h"
#include "core/math/vector2i.h"
#include "tests/test_macros.h"
namespace TestVector2i {
@ -165,4 +166,5 @@ TEST_CASE("[Vector2i] Abs and sign methods") {
vector2.sign() == Vector2i(1, -1),
"Vector2i sign should work as expected.");
}
} // namespace TestVector2i

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vector3.h */
/* test_vector3.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vector3)
#include "core/math/vector3.h"
#include "tests/test_macros.h"
namespace TestVector3 {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vector3i.h */
/* test_vector3i.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vector3i)
#include "core/math/vector3i.h"
#include "tests/test_macros.h"
namespace TestVector3i {
@ -164,4 +165,5 @@ TEST_CASE("[Vector3i] Abs and sign methods") {
vector2.sign() == Vector3i(1, -1, -1),
"Vector3i sign should work as expected.");
}
} // namespace TestVector3i

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vector4.h */
/* test_vector4.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vector4)
#include "core/math/vector4.h"
#include "tests/test_macros.h"
namespace TestVector4 {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vector4i.h */
/* test_vector4i.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vector4i)
#include "core/math/vector4i.h"
#include "tests/test_macros.h"
namespace TestVector4i {
@ -168,4 +169,5 @@ TEST_CASE("[Vector4i] Abs and sign methods") {
vector2.sign() == Vector4i(1, -1, -1, 1),
"Vector4i sign should work as expected.");
}
} // namespace TestVector4i

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_class_db.h */
/* test_class_db.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_class_db)
#include "core/core_bind.h"
#include "core/core_constants.h"
#include "core/object/class_db.h"
#include "tests/test_macros.h"
namespace TestClassDB {
struct TypeReference {
@ -887,4 +887,5 @@ TEST_SUITE("[ClassDB]") {
}
}
}
} // namespace TestClassDB

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_method_bind.h */
/* test_method_bind.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_method_bind)
#include "core/object/class_db.h"
#include "tests/test_macros.h"
namespace TestMethodBind {
class MethodBindTester : public Object {
@ -171,4 +171,5 @@ TEST_CASE("[MethodBind] check all method binds") {
memdelete(mbt);
}
} // namespace TestMethodBind

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_object.h */
/* test_object.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,17 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_object)
#include "core/object/class_db.h"
#include "core/object/object.h"
#include "core/object/script_language.h"
#include "tests/test_macros.h"
namespace TestObject {
// Declared in global namespace because of GDCLASS macro warning (Windows):
// "Unqualified friend declaration referring to type outside of the nearest enclosing namespace
// is a Microsoft extension; add a nested name specifier".
class _TestDerivedObject : public Object {
GDCLASS(_TestDerivedObject, Object);
@ -56,8 +55,6 @@ public:
int get_property() const { return property_value; }
};
namespace TestObject {
class _MockScriptInstance : public ScriptInstance {
StringName property_name = "NO_NAME";
Variant property_value;

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_undo_redo.h */
/* test_undo_redo.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "core/object/undo_redo.h"
#include "tests/test_macros.h"
// Declared in global namespace because of GDCLASS macro warning (Windows):
// "Unqualified friend declaration referring to type outside of the nearest enclosing namespace
// is a Microsoft extension; add a nested name specifier".
TEST_FORCE_LINK(test_undo_redo)
#include "core/object/undo_redo.h"
namespace TestUndoRedo {
class _TestUndoRedoObject : public Object {
GDCLASS(_TestUndoRedoObject, Object);
int property_value = 0;
@ -54,8 +54,6 @@ public:
void subtract_from_property(int value) { property_value -= value; }
};
namespace TestUndoRedo {
void set_property_action(UndoRedo *undo_redo, const String &name, _TestUndoRedoObject *test_object, int value, UndoRedo::MergeMode merge_mode = UndoRedo::MERGE_DISABLE) {
undo_redo->create_action(name, merge_mode);
undo_redo->add_do_property(test_object, "property", value);
@ -196,4 +194,4 @@ TEST_CASE("[UndoRedo] Merge Method UndoRedo") {
memdelete(undo_redo);
}
} //namespace TestUndoRedo
} // namespace TestUndoRedo

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_os.h */
/* test_os.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_os)
#include "core/os/os.h"
#include "thirdparty/doctest/doctest.h"
namespace TestOS {
TEST_CASE("[OS] Environment variables") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_fuzzy_search.h */
/* test_fuzzy_search.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "core/string/fuzzy_search.h"
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_fuzzy_search)
#include "core/io/file_access.h"
#include "core/string/fuzzy_search.h"
#include "tests/test_utils.h"
namespace TestFuzzySearch {
struct FuzzySearchTestCase {
@ -77,4 +80,4 @@ TEST_CASE("[FuzzySearch] Test fuzzy search results") {
}
}
} //namespace TestFuzzySearch
} // namespace TestFuzzySearch

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_node_path.h */
/* test_node_path.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_node_path)
#include "core/string/node_path.h"
#include "tests/test_macros.h"
namespace TestNodePath {
TEST_CASE("[NodePath] Relative path") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_string.h */
/* test_string.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_string)
#include "core/string/ustring.h"
#include "tests/test_macros.h"
namespace TestString {
int u32scmp(const char32_t *l, const char32_t *r) {
@ -2235,4 +2235,5 @@ TEST_CASE("[String][URL] Parse URL") {
#undef CHECK_URL
}
} // namespace TestString

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_translation.h */
/* test_translation.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_translation)
#include "core/string/optimized_translation.h"
#include "core/string/plural_rules.h"
@ -39,7 +41,6 @@
#include "editor/import/resource_importer_csv_translation.h"
#endif
#include "tests/test_macros.h"
#include "tests/test_utils.h"
namespace TestTranslation {
@ -260,6 +261,7 @@ TEST_CASE("[TranslationCSV] CSV import") {
TranslationServer::get_singleton()->remove_domain("godot.test");
}
#endif // TOOLS_ENABLED
} // namespace TestTranslation

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_translation_server.h */
/* test_translation_server.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_translation_server)
#include "core/string/translation_server.h"
#include "tests/test_macros.h"
namespace TestTranslationServer {
TEST_CASE("[TranslationServer] Translation operations") {
Ref<TranslationDomain> td = TranslationServer::get_singleton()->get_or_add_domain("godot.test");
CHECK(td->get_translations().is_empty());
@ -236,4 +237,5 @@ TEST_CASE("[TranslationServer] Comparing locales") {
CHECK(res == 10);
}
} // namespace TestTranslationServer

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_a_hash_map.h */
/* test_a_hash_map.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_a_hash_map)
#include "core/templates/a_hash_map.h"
#include "tests/test_macros.h"
namespace TestAHashMap {
TEST_CASE("[AHashMap] List initialization") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_command_queue.h */
/* test_command_queue.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_command_queue)
#include "core/config/project_settings.h"
#include "core/math/random_number_generator.h"
@ -36,7 +38,6 @@
#include "core/os/os.h"
#include "core/os/thread.h"
#include "core/templates/command_queue_mt.h"
#include "tests/test_macros.h"
namespace TestCommandQueue {
@ -518,4 +519,5 @@ TEST_CASE("[CommandQueue] Test Parameter Passing Semantics") {
sts.destroy_threads();
}
} // namespace TestCommandQueue

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_fixed_vector.h */
/* test_fixed_vector.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_fixed_vector)
#include "core/templates/fixed_vector.h"
#include "tests/test_macros.h"
namespace TestFixedVector {
struct MoveOnly {
@ -133,4 +133,4 @@ TEST_CASE("[FixedVector] Alignment Checks") {
CHECK((size_t)&vector_uint64[3] % alignof(uint64_t) == 0);
}
} //namespace TestFixedVector
} // namespace TestFixedVector

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_hash_map.h */
/* test_hash_map.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_hash_map)
#include "core/templates/hash_map.h"
#include "tests/test_macros.h"
namespace TestHashMap {
TEST_CASE("[HashMap] List initialization") {
@ -173,4 +173,5 @@ TEST_CASE("[HashMap] Sort") {
CHECK_EQ(kv.key, i);
}
}
} // namespace TestHashMap

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_hash_set.h */
/* test_hash_set.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_hash_set)
#include "core/templates/hash_set.h"
#include "tests/test_macros.h"
namespace TestHashSet {
TEST_CASE("[HashSet] List initialization") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_list.h */
/* test_list.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_list)
#include "core/templates/list.h"
#include "tests/test_macros.h"
namespace TestList {
static void populate_integers(List<int> &p_list, List<int>::Element *r_elements[], int num_elements) {
@ -545,4 +545,5 @@ TEST_CASE("[List] Swap adjacent back and front (reverse order of elements)") {
}
}
}
} // namespace TestList

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_local_vector.h */
/* test_local_vector.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_local_vector)
#include "core/templates/local_vector.h"
#include "tests/test_macros.h"
namespace TestLocalVector {
TEST_CASE("[LocalVector] List Initialization.") {
@ -260,4 +260,5 @@ TEST_CASE("[LocalVector] Size / Resize / Reserve.") {
CHECK(vector.size() == 4);
CHECK(vector.get_capacity() >= 4);
}
} // namespace TestLocalVector

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_lru.h */
/* test_lru.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_lru)
#include "core/templates/lru.h"
#include "tests/test_macros.h"
namespace TestLRU {
TEST_CASE("[LRU] Store and read") {
@ -93,4 +93,5 @@ TEST_CASE("[LRU] Resize and clear") {
CHECK(!lru.has(3));
CHECK(!lru.has(4));
}
} // namespace TestLRU

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_paged_array.h */
/* test_paged_array.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,16 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_paged_array)
#include "core/templates/paged_array.h"
#include "thirdparty/doctest/doctest.h"
namespace TestPagedArray {
// PagedArray
TEST_CASE("[PagedArray] Simple fill and refill") {
PagedArrayPool<uint32_t> pool;
PagedArray<uint32_t> array;

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_rid.h */
/* test_rid.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,20 +28,21 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_rid)
#include "core/os/thread.h"
#include "core/templates/local_vector.h"
#include "core/templates/rid.h"
#include "core/templates/rid_owner.h"
#include "tests/test_macros.h"
#ifdef TSAN_ENABLED
#include <sanitizer/tsan_interface.h>
#endif
namespace TestRID {
TEST_CASE("[RID] Default Constructor") {
RID rid;

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_self_list.h */
/* test_self_list.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_self_list)
#include "core/templates/self_list.h"
#include "tests/test_macros.h"
namespace TestSelfList {
TEST_CASE("[SelfList] Sort") {
@ -69,4 +69,5 @@ TEST_CASE("[SelfList] Sort") {
element.remove_from_list();
}
}
} // namespace TestSelfList

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_span.h */
/* test_span.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_span)
#include "core/templates/span.h"
#include "tests/test_macros.h"
namespace TestSpan {
TEST_CASE("[Span] Constexpr Validators") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vector.h */
/* test_vector.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vector)
#include "core/templates/vector.h"
#include "tests/test_macros.h"
namespace TestVector {
TEST_CASE("[Vector] List initialization") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_vset.h */
/* test_vset.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_vset)
#include "core/templates/vset.h"
#include "tests/test_macros.h"
namespace TestVSet {
template <typename T>

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_crypto.h */
/* test_crypto.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_crypto)
#include "core/crypto/crypto.h"
#include "tests/test_macros.h"
namespace TestCrypto {
@ -67,4 +68,5 @@ TEST_CASE("[Crypto] PackedByteArray constant time compare") {
equal = crypto.constant_time_compare(p1, p2);
CHECK(!equal);
}
} // namespace TestCrypto

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_hashing_context.h */
/* test_hashing_context.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_hashing_context)
#include "core/crypto/hashing_context.h"
#include "tests/test_macros.h"
namespace TestHashingContext {
TEST_CASE("[HashingContext] Default - MD5/SHA1/SHA256") {
@ -159,4 +159,5 @@ TEST_CASE("[HashingContext] Invalid use of finish") {
"Calling 'finish' before 'start' should return an empty byte array.");
ERR_PRINT_ON;
}
} // namespace TestHashingContext

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_time.h */
/* test_time.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_time)
#include "core/os/time.h"
#include "thirdparty/doctest/doctest.h"
namespace TestTime {
#define YEAR_KEY "year"
#define MONTH_KEY "month"
@ -43,8 +45,6 @@
#define SECOND_KEY "second"
#define DST_KEY "dst"
namespace TestTime {
TEST_CASE("[Time] Unix time conversion to/from datetime string") {
const Time *time = Time::get_singleton();

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_validate_testing.h */
/* test_validate_testing.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_validate_testing)
#include "core/core_globals.h"
#include "core/os/os.h"
#include "tests/test_macros.h"
#include "tests/test_tools.h"
namespace TestValidateTesting {
TEST_SUITE("Validate tests") {
TEST_CASE("Always pass") {
CHECK(true);
@ -200,3 +202,5 @@ TEST_SUITE("Validate tests") {
REQUIRE(ed.has_error);
}
}
} // namespace TestValidateTesting

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_worker_thread_pool.h */
/* test_worker_thread_pool.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_worker_thread_pool)
#include "core/object/worker_thread_pool.h"
#include "tests/test_macros.h"
namespace TestWorkerThreadPool {
static LocalVector<SafeNumeric<int>> counter;

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_array.h */
/* test_array.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_array)
#include "core/variant/array.h"
#include "tests/test_macros.h"
#include "tests/test_tools.h"
namespace TestArray {
TEST_CASE("[Array] initializer list") {
Array arr = { 0, 1, "test", true, { 0.0, 1.0 } };
CHECK(arr.size() == 5);

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_callable.h */
/* test_callable.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_callable)
#include "core/object/class_db.h"
#include "core/object/object.h"
#include "tests/test_macros.h"
namespace TestCallable {
class TestClass : public Object {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_dictionary.h */
/* test_dictionary.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "core/variant/typed_dictionary.h"
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_dictionary)
#include "core/variant/typed_dictionary.h"
namespace TestDictionary {
TEST_CASE("[Dictionary] Assignment using bracket notation ([])") {
Dictionary map;
map["Hello"] = 0;

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_variant.h */
/* test_variant.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_variant)
#include "core/variant/variant.h"
#include "core/variant/variant_parser.h"
#include "tests/test_macros.h"
namespace TestVariant {
TEST_CASE("[Variant] Writer and parser integer") {
int64_t a32 = 2147483648; // 2^31, so out of bounds for 32-bit signed int [-2^31, +2^31-1].
String a32_str;

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_variant_utility.h */
/* test_variant_utility.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_variant_utility)
#include "core/variant/variant_utility.h"
#include "tests/test_macros.h"
namespace TestVariantUtility {
TEST_CASE("[VariantUtility] Type conversion") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_animation.h */
/* test_animation.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_animation)
#include "scene/resources/animation.h"
#include "tests/test_macros.h"
namespace TestAnimation {
TEST_CASE("[Animation] Empty animation getters") {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_animation_blend_tree.h */
/* test_animation_blend_tree.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_animation_blend_tree)
#include "scene/animation/animation_blend_tree.h"
#include "tests/test_macros.h"
#include "tests/test_utils.h"
namespace TestAnimationBlendTree {
TEST_CASE("[SceneTree][AnimationBlendTree] Create AnimationBlendTree and add AnimationNode") {
Ref<AnimationNodeBlendTree> blend_tree;
blend_tree.instantiate();
@ -81,4 +82,4 @@ TEST_CASE("[SceneTree][AnimationBlendTree] Create AnimationBlendTree and add Ani
CHECK_EQ(connections[0], StringName());
}
} //namespace TestAnimationBlendTree
} // namespace TestAnimationBlendTree

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_animation_player.h */
/* test_animation_player.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,11 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_animation_player)
#include "scene/animation/animation_player.h"
#include "scene/resources/animation.h"
#include "tests/test_macros.h"
namespace TestAnimationPlayer {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_arraymesh.h */
/* test_arraymesh.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_arraymesh)
#ifndef _3D_DISABLED
#include "scene/resources/3d/primitive_meshes.h"
#include "scene/resources/mesh.h"
#include "tests/test_macros.h"
namespace TestArrayMesh {
TEST_CASE("[SceneTree][ArrayMesh] Adding and modifying blendshapes.") {
@ -444,3 +446,5 @@ TEST_CASE("[SceneTree][ArrayMesh] Get/Set mesh metadata and actions") {
}
} // namespace TestArrayMesh
#endif // _3D_DISABLED

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_audio_stream_wav.h */
/* test_audio_stream_wav.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_audio_stream_wav)
#include "core/io/file_access.h"
#include "core/io/marshalls.h"
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "scene/resources/audio_stream_wav.h"
#include "tests/test_macros.h"
#include "tests/test_utils.h"
namespace TestAudioStreamWAV {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_bit_map.h */
/* test_bit_map.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_bit_map)
#include "core/os/memory.h"
#include "scene/resources/bit_map.h"
#include "tests/test_macros.h"
namespace TestBitmap {
namespace TestBitMap {
void reset_bit_map(BitMap &p_bm) {
Size2i size = p_bm.get_size();
@ -499,4 +500,4 @@ TEST_CASE("[BitMap] Clip to polygon") {
CHECK_MESSAGE(polygons[0].size() == 6, "The polygon should have exactly 6 points");
}
} // namespace TestBitmap
} // namespace TestBitMap

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_button.h */
/* test_button.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_button)
#include "scene/gui/button.h"
#include "scene/main/window.h"
#include "tests/test_macros.h"
namespace TestButton {
TEST_CASE("[SceneTree][Button] is_hovered()") {
// Create new button instance.
Button *button = memnew(Button);
@ -61,4 +62,4 @@ TEST_CASE("[SceneTree][Button] is_hovered()") {
memdelete(button);
}
} //namespace TestButton
} // namespace TestButton

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_camera_2d.h */
/* test_camera_2d.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,12 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_camera_2d)
#include "scene/2d/camera_2d.h"
#include "scene/main/viewport.h"
#include "scene/main/window.h"
#include "tests/test_macros.h"
namespace TestCamera2D {

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_camera_3d.h */
/* test_camera_3d.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,17 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_camera_3d)
#ifndef _3D_DISABLED
#include "scene/3d/camera_3d.h"
#include "scene/main/viewport.h"
#include "scene/main/window.h"
#include "tests/test_macros.h"
namespace TestCamera3D {
TEST_CASE("[SceneTree][Camera3D] Getters and setters") {
Camera3D *test_camera = memnew(Camera3D);
@ -366,3 +370,7 @@ TEST_CASE("[SceneTree][Camera3D] Project ray") {
memdelete(test_camera);
memdelete(mock_viewport);
}
} // namespace TestCamera3D
#endif // _3D_DISABLED

View file

@ -1,5 +1,5 @@
/**************************************************************************/
/* test_code_edit.h */
/* test_code_edit.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,13 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#pragma once
#include "tests/test_macros.h"
TEST_FORCE_LINK(test_code_edit)
#ifndef ADVANCED_GUI_DISABLED
#include "scene/gui/code_edit.h"
#include "tests/test_macros.h"
namespace TestCodeEdit {
TEST_CASE("[SceneTree][CodeEdit] line gutters") {
CodeEdit *code_edit = memnew(CodeEdit);
SceneTree::get_singleton()->get_root()->add_child(code_edit);
@ -5708,3 +5711,5 @@ func _ready():
}
} // namespace TestCodeEdit
#endif // ADVANCED_GUI_DISABLED

Some files were not shown because too many files have changed in this diff Show more