MCPcopy Create free account
hub / github.com/endbasic/endbasic / set

Method set

sdl/src/console.rs:305–320  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

303 /// Initializes per-test global state.
304 #[allow(unsafe_code)]
305 fn set() -> Self {
306 let previous_sdl_videodriver = env::var_os("SDL_VIDEODRIVER");
307 let previous_sdl_render_driver = env::var_os("SDL_RENDER_DRIVER");
308 // The global `TEST_LOCK` guarantees that no other SDL test mutates the process
309 // environment while these values are temporarily overridden.
310 unsafe {
311 // On Windows, the SDL2 library that we use doesn't have offscreen support
312 // and, on macOS, offscreen fails to initialize as it needs OpenGL to be
313 // present. So... for now, only do the nice thing on Linux.
314 if cfg!(target_os = "linux") {
315 env::set_var("SDL_VIDEODRIVER", "offscreen");
316 env::set_var("SDL_RENDER_DRIVER", "software");
317 }
318 }
319 Self { previous_sdl_videodriver, previous_sdl_render_driver }
320 }
321 }
322
323 impl Drop for TestLockState {

Callers 8

dropMethod · 0.80
with_reserved_tempMethod · 0.80
renameMethod · 0.80
putMethod · 0.80
test_webdrive_delete_okFunction · 0.80
test_webdrive_enumerateFunction · 0.80
test_webdrive_getFunction · 0.80

Calls

no outgoing calls

Tested by 4

test_webdrive_delete_okFunction · 0.64
test_webdrive_enumerateFunction · 0.64
test_webdrive_getFunction · 0.64