test_main.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. /**************************************************************************/
  2. /* test_main.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "test_main.h"
  31. #include "core/error/error_macros.h"
  32. #include "core/io/dir_access.h"
  33. #include "modules/modules_enabled.gen.h"
  34. #ifdef TOOLS_ENABLED
  35. #include "editor/editor_paths.h"
  36. #include "editor/editor_settings.h"
  37. #endif // TOOLS_ENABLED
  38. #include "tests/core/config/test_project_settings.h"
  39. #include "tests/core/input/test_input_event.h"
  40. #include "tests/core/input/test_input_event_key.h"
  41. #include "tests/core/input/test_input_event_mouse.h"
  42. #include "tests/core/input/test_shortcut.h"
  43. #include "tests/core/io/test_config_file.h"
  44. #include "tests/core/io/test_file_access.h"
  45. #include "tests/core/io/test_http_client.h"
  46. #include "tests/core/io/test_image.h"
  47. #include "tests/core/io/test_ip.h"
  48. #include "tests/core/io/test_json.h"
  49. #include "tests/core/io/test_json_native.h"
  50. #include "tests/core/io/test_logger.h"
  51. #include "tests/core/io/test_marshalls.h"
  52. #include "tests/core/io/test_packet_peer.h"
  53. #include "tests/core/io/test_pck_packer.h"
  54. #include "tests/core/io/test_resource.h"
  55. #include "tests/core/io/test_resource_uid.h"
  56. #include "tests/core/io/test_stream_peer.h"
  57. #include "tests/core/io/test_stream_peer_buffer.h"
  58. #include "tests/core/io/test_stream_peer_gzip.h"
  59. #include "tests/core/io/test_tcp_server.h"
  60. #include "tests/core/io/test_udp_server.h"
  61. #include "tests/core/io/test_xml_parser.h"
  62. #include "tests/core/math/test_aabb.h"
  63. #include "tests/core/math/test_astar.h"
  64. #include "tests/core/math/test_basis.h"
  65. #include "tests/core/math/test_color.h"
  66. #include "tests/core/math/test_expression.h"
  67. #include "tests/core/math/test_geometry_2d.h"
  68. #include "tests/core/math/test_geometry_3d.h"
  69. #include "tests/core/math/test_math_funcs.h"
  70. #include "tests/core/math/test_plane.h"
  71. #include "tests/core/math/test_projection.h"
  72. #include "tests/core/math/test_quaternion.h"
  73. #include "tests/core/math/test_random_number_generator.h"
  74. #include "tests/core/math/test_rect2.h"
  75. #include "tests/core/math/test_rect2i.h"
  76. #include "tests/core/math/test_transform_2d.h"
  77. #include "tests/core/math/test_transform_3d.h"
  78. #include "tests/core/math/test_vector2.h"
  79. #include "tests/core/math/test_vector2i.h"
  80. #include "tests/core/math/test_vector3.h"
  81. #include "tests/core/math/test_vector3i.h"
  82. #include "tests/core/math/test_vector4.h"
  83. #include "tests/core/math/test_vector4i.h"
  84. #include "tests/core/object/test_class_db.h"
  85. #include "tests/core/object/test_method_bind.h"
  86. #include "tests/core/object/test_object.h"
  87. #include "tests/core/object/test_undo_redo.h"
  88. #include "tests/core/os/test_os.h"
  89. #include "tests/core/string/test_fuzzy_search.h"
  90. #include "tests/core/string/test_node_path.h"
  91. #include "tests/core/string/test_string.h"
  92. #include "tests/core/string/test_translation.h"
  93. #include "tests/core/string/test_translation_server.h"
  94. #include "tests/core/templates/test_a_hash_map.h"
  95. #include "tests/core/templates/test_command_queue.h"
  96. #include "tests/core/templates/test_fixed_vector.h"
  97. #include "tests/core/templates/test_hash_map.h"
  98. #include "tests/core/templates/test_hash_set.h"
  99. #include "tests/core/templates/test_list.h"
  100. #include "tests/core/templates/test_local_vector.h"
  101. #include "tests/core/templates/test_lru.h"
  102. #include "tests/core/templates/test_paged_array.h"
  103. #include "tests/core/templates/test_rid.h"
  104. #include "tests/core/templates/test_self_list.h"
  105. #include "tests/core/templates/test_span.h"
  106. #include "tests/core/templates/test_vector.h"
  107. #include "tests/core/templates/test_vset.h"
  108. #include "tests/core/test_crypto.h"
  109. #include "tests/core/test_hashing_context.h"
  110. #include "tests/core/test_time.h"
  111. #include "tests/core/threads/test_worker_thread_pool.h"
  112. #include "tests/core/variant/test_array.h"
  113. #include "tests/core/variant/test_callable.h"
  114. #include "tests/core/variant/test_dictionary.h"
  115. #include "tests/core/variant/test_variant.h"
  116. #include "tests/core/variant/test_variant_utility.h"
  117. #include "tests/scene/test_animation.h"
  118. #include "tests/scene/test_animation_blend_tree.h"
  119. #include "tests/scene/test_audio_stream_wav.h"
  120. #include "tests/scene/test_bit_map.h"
  121. #include "tests/scene/test_button.h"
  122. #include "tests/scene/test_camera_2d.h"
  123. #include "tests/scene/test_control.h"
  124. #include "tests/scene/test_curve.h"
  125. #include "tests/scene/test_curve_2d.h"
  126. #include "tests/scene/test_curve_3d.h"
  127. #include "tests/scene/test_fontfile.h"
  128. #include "tests/scene/test_gradient.h"
  129. #include "tests/scene/test_gradient_texture.h"
  130. #include "tests/scene/test_image_texture.h"
  131. #include "tests/scene/test_image_texture_3d.h"
  132. #include "tests/scene/test_instance_placeholder.h"
  133. #include "tests/scene/test_node.h"
  134. #include "tests/scene/test_node_2d.h"
  135. #include "tests/scene/test_packed_scene.h"
  136. #include "tests/scene/test_parallax_2d.h"
  137. #include "tests/scene/test_path_2d.h"
  138. #include "tests/scene/test_path_follow_2d.h"
  139. #include "tests/scene/test_sprite_2d.h"
  140. #include "tests/scene/test_sprite_frames.h"
  141. #include "tests/scene/test_style_box_texture.h"
  142. #include "tests/scene/test_texture_progress_bar.h"
  143. #include "tests/scene/test_theme.h"
  144. #include "tests/scene/test_timer.h"
  145. #include "tests/scene/test_viewport.h"
  146. #include "tests/scene/test_visual_shader.h"
  147. #include "tests/scene/test_window.h"
  148. #include "tests/servers/rendering/test_shader_preprocessor.h"
  149. #include "tests/servers/test_nav_heap.h"
  150. #include "tests/servers/test_text_server.h"
  151. #include "tests/test_validate_testing.h"
  152. #ifndef ADVANCED_GUI_DISABLED
  153. #include "tests/scene/test_code_edit.h"
  154. #include "tests/scene/test_color_picker.h"
  155. #include "tests/scene/test_graph_node.h"
  156. #include "tests/scene/test_option_button.h"
  157. #include "tests/scene/test_split_container.h"
  158. #include "tests/scene/test_tab_bar.h"
  159. #include "tests/scene/test_tab_container.h"
  160. #include "tests/scene/test_text_edit.h"
  161. #include "tests/scene/test_tree.h"
  162. #endif // ADVANCED_GUI_DISABLED
  163. #ifndef _3D_DISABLED
  164. #include "tests/core/math/test_triangle_mesh.h"
  165. #include "tests/scene/test_arraymesh.h"
  166. #include "tests/scene/test_camera_3d.h"
  167. #include "tests/scene/test_convert_transform_modifier_3d.h"
  168. #include "tests/scene/test_copy_transform_modifier_3d.h"
  169. #include "tests/scene/test_gltf_document.h"
  170. #include "tests/scene/test_path_3d.h"
  171. #include "tests/scene/test_path_follow_3d.h"
  172. #include "tests/scene/test_primitives.h"
  173. #include "tests/scene/test_skeleton_3d.h"
  174. #include "tests/scene/test_sky.h"
  175. #endif // _3D_DISABLED
  176. #ifndef PHYSICS_3D_DISABLED
  177. #include "tests/scene/test_height_map_shape_3d.h"
  178. #include "tests/scene/test_physics_material.h"
  179. #endif // PHYSICS_3D_DISABLED
  180. #ifdef MODULE_NAVIGATION_2D_ENABLED
  181. #include "tests/scene/test_navigation_agent_2d.h"
  182. #include "tests/scene/test_navigation_obstacle_2d.h"
  183. #include "tests/scene/test_navigation_region_2d.h"
  184. #include "tests/servers/test_navigation_server_2d.h"
  185. #endif // MODULE_NAVIGATION_2D_ENABLED
  186. #ifdef MODULE_NAVIGATION_3D_ENABLED
  187. #include "tests/scene/test_navigation_agent_3d.h"
  188. #include "tests/scene/test_navigation_obstacle_3d.h"
  189. #include "tests/scene/test_navigation_region_3d.h"
  190. #include "tests/servers/test_navigation_server_3d.h"
  191. #endif // MODULE_NAVIGATION_3D_ENABLED
  192. #include "modules/modules_tests.gen.h"
  193. #include "tests/display_server_mock.h"
  194. #include "tests/test_macros.h"
  195. #include "scene/theme/theme_db.h"
  196. #ifndef NAVIGATION_2D_DISABLED
  197. #include "servers/navigation_server_2d.h"
  198. #endif // NAVIGATION_2D_DISABLED
  199. #ifndef NAVIGATION_3D_DISABLED
  200. #include "servers/navigation_server_3d.h"
  201. #endif // NAVIGATION_3D_DISABLED
  202. #ifndef PHYSICS_2D_DISABLED
  203. #include "servers/physics_server_2d.h"
  204. #include "servers/physics_server_2d_dummy.h"
  205. #endif // PHYSICS_2D_DISABLED
  206. #ifndef PHYSICS_3D_DISABLED
  207. #include "servers/physics_server_3d.h"
  208. #include "servers/physics_server_3d_dummy.h"
  209. #endif // PHYSICS_3D_DISABLED
  210. #include "servers/rendering/rendering_server_default.h"
  211. int test_main(int argc, char *argv[]) {
  212. bool run_tests = true;
  213. // Convert arguments to Godot's command-line.
  214. List<String> args;
  215. for (int i = 0; i < argc; i++) {
  216. args.push_back(String::utf8(argv[i]));
  217. }
  218. OS::get_singleton()->set_cmdline("", args, List<String>());
  219. DisplayServerMock::register_mock_driver();
  220. WorkerThreadPool::get_singleton()->init();
  221. {
  222. const String test_path = TestUtils::get_temp_path("");
  223. Ref<DirAccess> da = DirAccess::open(test_path); // get_temp_path() automatically creates the folder.
  224. ERR_FAIL_COND_V(da.is_null(), 0);
  225. ERR_FAIL_COND_V_MSG(da->erase_contents_recursive() != OK, 0, "Failed to delete files");
  226. }
  227. // Run custom test tools.
  228. if (test_commands) {
  229. for (const KeyValue<String, TestFunc> &E : (*test_commands)) {
  230. if (args.find(E.key)) {
  231. const TestFunc &test_func = E.value;
  232. test_func();
  233. run_tests = false;
  234. break;
  235. }
  236. }
  237. if (!run_tests) {
  238. delete test_commands;
  239. return 0;
  240. }
  241. }
  242. // Doctest runner.
  243. doctest::Context test_context;
  244. LocalVector<String> test_args;
  245. // Clean arguments of "--test" from the args.
  246. for (int x = 0; x < argc; x++) {
  247. String arg = String(argv[x]);
  248. if (arg != "--test") {
  249. test_args.push_back(arg);
  250. }
  251. }
  252. if (test_args.size() > 0) {
  253. // Convert Godot command line arguments back to standard arguments.
  254. char **doctest_args = new char *[test_args.size()];
  255. for (uint32_t x = 0; x < test_args.size(); x++) {
  256. // Operation to convert Godot string to non wchar string.
  257. CharString cs = test_args[x].utf8();
  258. const char *str = cs.get_data();
  259. // Allocate the string copy.
  260. doctest_args[x] = new char[strlen(str) + 1];
  261. // Copy this into memory.
  262. memcpy(doctest_args[x], str, strlen(str) + 1);
  263. }
  264. test_context.applyCommandLine(test_args.size(), doctest_args);
  265. for (uint32_t x = 0; x < test_args.size(); x++) {
  266. delete[] doctest_args[x];
  267. }
  268. delete[] doctest_args;
  269. }
  270. return test_context.run();
  271. }
  272. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  273. struct GodotTestCaseListener : public doctest::IReporter {
  274. GodotTestCaseListener(const doctest::ContextOptions &p_in) {}
  275. SignalWatcher *signal_watcher = nullptr;
  276. #ifndef PHYSICS_2D_DISABLED
  277. PhysicsServer2D *physics_server_2d = nullptr;
  278. #endif // PHYSICS_2D_DISABLED
  279. #ifndef PHYSICS_3D_DISABLED
  280. PhysicsServer3D *physics_server_3d = nullptr;
  281. #endif // PHYSICS_3D_DISABLED
  282. #ifndef NAVIGATION_2D_DISABLED
  283. NavigationServer2D *navigation_server_2d = nullptr;
  284. #endif // NAVIGATION_2D_DISABLED
  285. #ifndef NAVIGATION_3D_DISABLED
  286. NavigationServer3D *navigation_server_3d = nullptr;
  287. #endif // NAVIGATION_3D_DISABLED
  288. void test_case_start(const doctest::TestCaseData &p_in) override {
  289. reinitialize();
  290. String name = String(p_in.m_name);
  291. String suite_name = String(p_in.m_test_suite);
  292. if (name.contains("[SceneTree]") || name.contains("[Editor]")) {
  293. memnew(MessageQueue);
  294. memnew(Input);
  295. Input::get_singleton()->set_use_accumulated_input(false);
  296. Error err = OK;
  297. OS::get_singleton()->set_has_server_feature_callback(nullptr);
  298. for (int i = 0; i < DisplayServer::get_create_function_count(); i++) {
  299. if (String("mock") == DisplayServer::get_create_function_name(i)) {
  300. DisplayServer::create(i, "", DisplayServer::WindowMode::WINDOW_MODE_MINIMIZED, DisplayServer::VSyncMode::VSYNC_ENABLED, 0, nullptr, Vector2i(0, 0), DisplayServer::SCREEN_PRIMARY, DisplayServer::CONTEXT_EDITOR, 0, err);
  301. break;
  302. }
  303. }
  304. memnew(RenderingServerDefault());
  305. RenderingServerDefault::get_singleton()->init();
  306. RenderingServerDefault::get_singleton()->set_render_loop_enabled(false);
  307. // ThemeDB requires RenderingServer to initialize the default theme.
  308. // So we have to do this for each test case. Also make sure there is
  309. // no residual theme from something else.
  310. ThemeDB::get_singleton()->finalize_theme();
  311. ThemeDB::get_singleton()->initialize_theme();
  312. #ifndef PHYSICS_3D_DISABLED
  313. physics_server_3d = PhysicsServer3DManager::get_singleton()->new_default_server();
  314. if (!physics_server_3d) {
  315. physics_server_3d = memnew(PhysicsServer3DDummy);
  316. }
  317. physics_server_3d->init();
  318. #endif // PHYSICS_3D_DISABLED
  319. #ifndef PHYSICS_2D_DISABLED
  320. physics_server_2d = PhysicsServer2DManager::get_singleton()->new_default_server();
  321. if (!physics_server_2d) {
  322. physics_server_2d = memnew(PhysicsServer2DDummy);
  323. }
  324. physics_server_2d->init();
  325. #endif // PHYSICS_2D_DISABLED
  326. ERR_PRINT_OFF;
  327. #ifndef NAVIGATION_3D_DISABLED
  328. navigation_server_3d = NavigationServer3DManager::new_default_server();
  329. #endif // NAVIGATION_3D_DISABLED
  330. #ifndef NAVIGATION_2D_DISABLED
  331. navigation_server_2d = NavigationServer2DManager::new_default_server();
  332. #endif // NAVIGATION_2D_DISABLED
  333. ERR_PRINT_ON;
  334. memnew(InputMap);
  335. InputMap::get_singleton()->load_default();
  336. memnew(SceneTree);
  337. SceneTree::get_singleton()->initialize();
  338. if (!DisplayServer::get_singleton()->has_feature(DisplayServer::Feature::FEATURE_SUBWINDOWS)) {
  339. SceneTree::get_singleton()->get_root()->set_embedding_subwindows(true);
  340. }
  341. #ifdef TOOLS_ENABLED
  342. if (name.contains("[Editor]")) {
  343. Engine::get_singleton()->set_editor_hint(true);
  344. EditorPaths::create();
  345. EditorSettings::create();
  346. }
  347. #endif // TOOLS_ENABLED
  348. return;
  349. }
  350. if (name.contains("[Audio]")) {
  351. // The last driver index should always be the dummy driver.
  352. int dummy_idx = AudioDriverManager::get_driver_count() - 1;
  353. AudioDriverManager::initialize(dummy_idx);
  354. AudioServer *audio_server = memnew(AudioServer);
  355. audio_server->init();
  356. return;
  357. }
  358. #ifndef NAVIGATION_3D_DISABLED
  359. if (suite_name.contains("[Navigation3D]") && navigation_server_3d == nullptr) {
  360. ERR_PRINT_OFF;
  361. navigation_server_3d = NavigationServer3DManager::new_default_server();
  362. ERR_PRINT_ON;
  363. return;
  364. }
  365. #endif // NAVIGATION_3D_DISABLED
  366. #ifndef NAVIGATION_2D_DISABLED
  367. if (suite_name.contains("[Navigation2D]") && navigation_server_2d == nullptr) {
  368. ERR_PRINT_OFF;
  369. navigation_server_2d = NavigationServer2DManager::new_default_server();
  370. ERR_PRINT_ON;
  371. return;
  372. }
  373. #endif // NAVIGATION_2D_DISABLED
  374. }
  375. void test_case_end(const doctest::CurrentTestCaseStats &) override {
  376. #ifdef TOOLS_ENABLED
  377. if (EditorSettings::get_singleton()) {
  378. EditorSettings::destroy();
  379. // Instantiating the EditorSettings singleton sets the locale to the editor's language.
  380. TranslationServer::get_singleton()->set_locale("en");
  381. }
  382. if (EditorPaths::get_singleton()) {
  383. EditorPaths::free();
  384. }
  385. #endif // TOOLS_ENABLED
  386. Engine::get_singleton()->set_editor_hint(false);
  387. if (SceneTree::get_singleton()) {
  388. SceneTree::get_singleton()->finalize();
  389. }
  390. if (MessageQueue::get_singleton()) {
  391. MessageQueue::get_singleton()->flush();
  392. }
  393. if (SceneTree::get_singleton()) {
  394. memdelete(SceneTree::get_singleton());
  395. }
  396. #ifndef NAVIGATION_3D_DISABLED
  397. if (navigation_server_3d) {
  398. memdelete(navigation_server_3d);
  399. navigation_server_3d = nullptr;
  400. }
  401. #endif // NAVIGATION_3D_DISABLED
  402. #ifndef NAVIGATION_2D_DISABLED
  403. if (navigation_server_2d) {
  404. memdelete(navigation_server_2d);
  405. navigation_server_2d = nullptr;
  406. }
  407. #endif // NAVIGATION_2D_DISABLED
  408. #ifndef PHYSICS_3D_DISABLED
  409. if (physics_server_3d) {
  410. physics_server_3d->finish();
  411. memdelete(physics_server_3d);
  412. physics_server_3d = nullptr;
  413. }
  414. #endif // PHYSICS_3D_DISABLED
  415. #ifndef PHYSICS_2D_DISABLED
  416. if (physics_server_2d) {
  417. physics_server_2d->finish();
  418. memdelete(physics_server_2d);
  419. physics_server_2d = nullptr;
  420. }
  421. #endif // PHYSICS_2D_DISABLED
  422. if (Input::get_singleton()) {
  423. memdelete(Input::get_singleton());
  424. }
  425. if (RenderingServer::get_singleton()) {
  426. // ThemeDB requires RenderingServer to finalize the default theme.
  427. // So we have to do this for each test case.
  428. ThemeDB::get_singleton()->finalize_theme();
  429. RenderingServer::get_singleton()->sync();
  430. RenderingServer::get_singleton()->global_shader_parameters_clear();
  431. RenderingServer::get_singleton()->finish();
  432. memdelete(RenderingServer::get_singleton());
  433. }
  434. if (DisplayServer::get_singleton()) {
  435. memdelete(DisplayServer::get_singleton());
  436. }
  437. if (InputMap::get_singleton()) {
  438. memdelete(InputMap::get_singleton());
  439. }
  440. if (MessageQueue::get_singleton()) {
  441. MessageQueue::get_singleton()->flush();
  442. memdelete(MessageQueue::get_singleton());
  443. }
  444. if (AudioServer::get_singleton()) {
  445. AudioServer::get_singleton()->finish();
  446. memdelete(AudioServer::get_singleton());
  447. }
  448. }
  449. void test_run_start() override {
  450. signal_watcher = memnew(SignalWatcher);
  451. }
  452. void test_run_end(const doctest::TestRunStats &) override {
  453. memdelete(signal_watcher);
  454. }
  455. void test_case_reenter(const doctest::TestCaseData &) override {
  456. reinitialize();
  457. }
  458. void subcase_start(const doctest::SubcaseSignature &) override {
  459. reinitialize();
  460. }
  461. void report_query(const doctest::QueryData &) override {}
  462. void test_case_exception(const doctest::TestCaseException &) override {}
  463. void subcase_end() override {}
  464. void log_assert(const doctest::AssertData &in) override {}
  465. void log_message(const doctest::MessageData &) override {}
  466. void test_case_skipped(const doctest::TestCaseData &) override {}
  467. private:
  468. void reinitialize() {
  469. Math::seed(0x60d07);
  470. SignalWatcher::get_singleton()->_clear_signals();
  471. }
  472. };
  473. REGISTER_LISTENER("GodotTestCaseListener", 1, GodotTestCaseListener);