| 1211 | |
| 1212 | #ifdef TOOLS_ENABLED |
| 1213 | bool OS_LinuxBSD::_test_create_rendering_device(const String &p_display_driver) const { |
| 1214 | // Tests Rendering Device creation. |
| 1215 | |
| 1216 | bool ok = false; |
| 1217 | #if defined(RD_ENABLED) |
| 1218 | Error err; |
| 1219 | RenderingContextDriver *rcd = nullptr; |
| 1220 | |
| 1221 | #if defined(VULKAN_ENABLED) |
| 1222 | #ifdef X11_ENABLED |
| 1223 | if (p_display_driver == "x11" || p_display_driver.is_empty()) { |
| 1224 | rcd = memnew(RenderingContextDriverVulkanX11); |
| 1225 | } |
| 1226 | #endif |
| 1227 | #ifdef WAYLAND_ENABLED |
| 1228 | if (p_display_driver == "wayland") { |
| 1229 | rcd = memnew(RenderingContextDriverVulkanWayland); |
| 1230 | } |
| 1231 | #endif |
| 1232 | #endif |
| 1233 | if (rcd != nullptr) { |
| 1234 | err = rcd->initialize(); |
| 1235 | if (err == OK) { |
| 1236 | RenderingDevice *rd = memnew(RenderingDevice); |
| 1237 | err = rd->initialize(rcd); |
| 1238 | memdelete(rd); |
| 1239 | rd = nullptr; |
| 1240 | if (err == OK) { |
| 1241 | ok = true; |
| 1242 | } |
| 1243 | } |
| 1244 | memdelete(rcd); |
| 1245 | rcd = nullptr; |
| 1246 | } |
| 1247 | #endif |
| 1248 | return ok; |
| 1249 | } |
| 1250 | |
| 1251 | bool OS_LinuxBSD::_test_create_rendering_device_and_gl(const String &p_display_driver) const { |
| 1252 | // Tests OpenGL context and Rendering Device simultaneous creation. This function is expected to crash on some drivers. |
nothing calls this directly
no test coverage detected