MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / main

Function main

crates/test-programs/src/bin/p1_fd_readdir.rs:272–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

270}
271
272fn main() {
273 let mut args = env::args();
274 let prog = args.next().unwrap();
275 let arg = if let Some(arg) = args.next() {
276 arg
277 } else {
278 eprintln!("usage: {prog} <scratch directory>");
279 process::exit(1);
280 };
281
282 // Open scratch directory
283 let dir_fd = match open_scratch_directory(&arg) {
284 Ok(dir_fd) => dir_fd,
285 Err(err) => {
286 eprintln!("{err}");
287 process::exit(1)
288 }
289 };
290
291 // Run the tests.
292 unsafe { test_fd_readdir(dir_fd) }
293 unsafe { test_fd_readdir_lots(dir_fd) }
294 unsafe { test_fd_readdir_unicode_boundary(dir_fd) }
295 unsafe { test_fd_readdir_past_end(dir_fd) }
296}

Callers

nothing calls this directly

Calls 7

open_scratch_directoryFunction · 0.85
test_fd_readdirFunction · 0.85
test_fd_readdir_lotsFunction · 0.85
test_fd_readdir_past_endFunction · 0.85
unwrapMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected