Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Rename test programs (#11828)

Yoshb315a0a89319
diff --git a/crates/test-programs/artifacts/build.rs b/crates/test-programs/artifacts/build.rs
index ef35e09023..7b215aa1cc 100644
--- a/crates/test-programs/artifacts/build.rs
+++ b/crates/test-programs/artifacts/build.rs
@@ -73,11 +73,11 @@ impl Artifacts {
// Bucket, based on the name of the test, into a "kind" which
// generates a `foreach_*` macro below.
let kind = match test.name.as_str() {
- s if s.starts_with("http_") => "http",
- s if s.starts_with("preview1_") => "preview1",
- s if s.starts_with("preview2_") => "preview2",
- s if s.starts_with("cli_") => "cli",
- s if s.starts_with("api_") => "api",
+ s if s.starts_with("p1_") => "p1",
+ s if s.starts_with("p2_http_") => "p2_http",
+ s if s.starts_with("p2_cli_") => "p2_cli",
+ s if s.starts_with("p2_api_") => "p2_api",
+ s if s.starts_with("p2_") => "p2",
s if s.starts_with("nn_") => "nn",
s if s.starts_with("piped_") => "piped",
s if s.starts_with("dwarf_") => "dwarf",
@@ -111,7 +111,7 @@ impl Artifacts {
let adapter = match test.name.as_str() {
"reactor" => &reactor_adapter,
s if s.starts_with("p3_") => &reactor_adapter,
- s if s.starts_with("api_proxy") => &proxy_adapter,
+ s if s.starts_with("p2_api_proxy") => &proxy_adapter,
_ => &command_adapter,
};
let path = match &test.core_wasm {
diff --git a/crates/test-programs/src/bin/preview1_big_random_buf.rs b/crates/test-programs/src/bin/p1_big_random_buf.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_big_random_buf.rs
rename to crates/test-programs/src/bin/p1_big_random_buf.rs
diff --git a/crates/test-programs/src/bin/cli_p1_much_stdout.rs b/crates/test-programs/src/bin/p1_cli_much_stdout.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_p1_much_stdout.rs
rename to crates/test-programs/src/bin/p1_cli_much_stdout.rs
diff --git a/crates/test-programs/src/bin/preview1_clock_time_get.rs b/crates/test-programs/src/bin/p1_clock_time_get.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_clock_time_get.rs
rename to crates/test-programs/src/bin/p1_clock_time_get.rs
diff --git a/crates/test-programs/src/bin/preview1_close_preopen.rs b/crates/test-programs/src/bin/p1_close_preopen.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_close_preopen.rs
rename to crates/test-programs/src/bin/p1_close_preopen.rs
diff --git a/crates/test-programs/src/bin/preview1_dangling_fd.rs b/crates/test-programs/src/bin/p1_dangling_fd.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_dangling_fd.rs
rename to crates/test-programs/src/bin/p1_dangling_fd.rs
diff --git a/crates/test-programs/src/bin/preview1_dangling_symlink.rs b/crates/test-programs/src/bin/p1_dangling_symlink.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_dangling_symlink.rs
rename to crates/test-programs/src/bin/p1_dangling_symlink.rs
diff --git a/crates/test-programs/src/bin/preview1_dir_fd_op_failures.rs b/crates/test-programs/src/bin/p1_dir_fd_op_failures.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_dir_fd_op_failures.rs
rename to crates/test-programs/src/bin/p1_dir_fd_op_failures.rs
diff --git a/crates/test-programs/src/bin/preview1_directory_seek.rs b/crates/test-programs/src/bin/p1_directory_seek.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_directory_seek.rs
rename to crates/test-programs/src/bin/p1_directory_seek.rs
diff --git a/crates/test-programs/src/bin/preview1_fd_advise.rs b/crates/test-programs/src/bin/p1_fd_advise.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_fd_advise.rs
rename to crates/test-programs/src/bin/p1_fd_advise.rs
diff --git a/crates/test-programs/src/bin/preview1_fd_filestat_get.rs b/crates/test-programs/src/bin/p1_fd_filestat_get.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_fd_filestat_get.rs
rename to crates/test-programs/src/bin/p1_fd_filestat_get.rs
diff --git a/crates/test-programs/src/bin/preview1_fd_filestat_set.rs b/crates/test-programs/src/bin/p1_fd_filestat_set.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_fd_filestat_set.rs
rename to crates/test-programs/src/bin/p1_fd_filestat_set.rs
diff --git a/crates/test-programs/src/bin/preview1_fd_flags_set.rs b/crates/test-programs/src/bin/p1_fd_flags_set.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_fd_flags_set.rs
rename to crates/test-programs/src/bin/p1_fd_flags_set.rs
diff --git a/crates/test-programs/src/bin/preview1_fd_readdir.rs b/crates/test-programs/src/bin/p1_fd_readdir.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_fd_readdir.rs
rename to crates/test-programs/src/bin/p1_fd_readdir.rs
diff --git a/crates/test-programs/src/bin/preview1_file_allocate.rs b/crates/test-programs/src/bin/p1_file_allocate.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_file_allocate.rs
rename to crates/test-programs/src/bin/p1_file_allocate.rs
diff --git a/crates/test-programs/src/bin/preview1_file_pread_pwrite.rs b/crates/test-programs/src/bin/p1_file_pread_pwrite.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_file_pread_pwrite.rs
rename to crates/test-programs/src/bin/p1_file_pread_pwrite.rs
diff --git a/crates/test-programs/src/bin/preview1_file_read_write.rs b/crates/test-programs/src/bin/p1_file_read_write.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_file_read_write.rs
rename to crates/test-programs/src/bin/p1_file_read_write.rs
diff --git a/crates/test-programs/src/bin/preview1_file_seek_tell.rs b/crates/test-programs/src/bin/p1_file_seek_tell.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_file_seek_tell.rs
rename to crates/test-programs/src/bin/p1_file_seek_tell.rs
diff --git a/crates/test-programs/src/bin/preview1_file_truncation.rs b/crates/test-programs/src/bin/p1_file_truncation.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_file_truncation.rs
rename to crates/test-programs/src/bin/p1_file_truncation.rs
diff --git a/crates/test-programs/src/bin/preview1_file_unbuffered_write.rs b/crates/test-programs/src/bin/p1_file_unbuffered_write.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_file_unbuffered_write.rs
rename to crates/test-programs/src/bin/p1_file_unbuffered_write.rs
diff --git a/crates/test-programs/src/bin/preview1_file_write.rs b/crates/test-programs/src/bin/p1_file_write.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_file_write.rs
rename to crates/test-programs/src/bin/p1_file_write.rs
diff --git a/crates/test-programs/src/bin/preview1_interesting_paths.rs b/crates/test-programs/src/bin/p1_interesting_paths.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_interesting_paths.rs
rename to crates/test-programs/src/bin/p1_interesting_paths.rs
diff --git a/crates/test-programs/src/bin/preview1_nofollow_errors.rs b/crates/test-programs/src/bin/p1_nofollow_errors.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_nofollow_errors.rs
rename to crates/test-programs/src/bin/p1_nofollow_errors.rs
diff --git a/crates/test-programs/src/bin/preview1_overwrite_preopen.rs b/crates/test-programs/src/bin/p1_overwrite_preopen.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_overwrite_preopen.rs
rename to crates/test-programs/src/bin/p1_overwrite_preopen.rs
diff --git a/crates/test-programs/src/bin/preview1_path_exists.rs b/crates/test-programs/src/bin/p1_path_exists.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_exists.rs
rename to crates/test-programs/src/bin/p1_path_exists.rs
diff --git a/crates/test-programs/src/bin/preview1_path_filestat.rs b/crates/test-programs/src/bin/p1_path_filestat.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_filestat.rs
rename to crates/test-programs/src/bin/p1_path_filestat.rs
diff --git a/crates/test-programs/src/bin/preview1_path_link.rs b/crates/test-programs/src/bin/p1_path_link.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_link.rs
rename to crates/test-programs/src/bin/p1_path_link.rs
diff --git a/crates/test-programs/src/bin/preview1_path_open_create_existing.rs b/crates/test-programs/src/bin/p1_path_open_create_existing.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_open_create_existing.rs
rename to crates/test-programs/src/bin/p1_path_open_create_existing.rs
diff --git a/crates/test-programs/src/bin/preview1_path_open_dirfd_not_dir.rs b/crates/test-programs/src/bin/p1_path_open_dirfd_not_dir.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_open_dirfd_not_dir.rs
rename to crates/test-programs/src/bin/p1_path_open_dirfd_not_dir.rs
diff --git a/crates/test-programs/src/bin/preview1_path_open_lots.rs b/crates/test-programs/src/bin/p1_path_open_lots.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_open_lots.rs
rename to crates/test-programs/src/bin/p1_path_open_lots.rs
diff --git a/crates/test-programs/src/bin/preview1_path_open_missing.rs b/crates/test-programs/src/bin/p1_path_open_missing.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_open_missing.rs
rename to crates/test-programs/src/bin/p1_path_open_missing.rs
diff --git a/crates/test-programs/src/bin/preview1_path_open_nonblock.rs b/crates/test-programs/src/bin/p1_path_open_nonblock.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_open_nonblock.rs
rename to crates/test-programs/src/bin/p1_path_open_nonblock.rs
diff --git a/crates/test-programs/src/bin/preview1_path_open_preopen.rs b/crates/test-programs/src/bin/p1_path_open_preopen.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_open_preopen.rs
rename to crates/test-programs/src/bin/p1_path_open_preopen.rs
diff --git a/crates/test-programs/src/bin/preview1_path_open_read_write.rs b/crates/test-programs/src/bin/p1_path_open_read_write.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_open_read_write.rs
rename to crates/test-programs/src/bin/p1_path_open_read_write.rs
diff --git a/crates/test-programs/src/bin/preview1_path_rename.rs b/crates/test-programs/src/bin/p1_path_rename.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_rename.rs
rename to crates/test-programs/src/bin/p1_path_rename.rs
diff --git a/crates/test-programs/src/bin/preview1_path_rename_dir_trailing_slashes.rs b/crates/test-programs/src/bin/p1_path_rename_dir_trailing_slashes.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_rename_dir_trailing_slashes.rs
rename to crates/test-programs/src/bin/p1_path_rename_dir_trailing_slashes.rs
diff --git a/crates/test-programs/src/bin/preview1_path_symlink_trailing_slashes.rs b/crates/test-programs/src/bin/p1_path_symlink_trailing_slashes.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_path_symlink_trailing_slashes.rs
rename to crates/test-programs/src/bin/p1_path_symlink_trailing_slashes.rs
diff --git a/crates/test-programs/src/bin/preview1_poll_oneoff_files.rs b/crates/test-programs/src/bin/p1_poll_oneoff_files.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_poll_oneoff_files.rs
rename to crates/test-programs/src/bin/p1_poll_oneoff_files.rs
diff --git a/crates/test-programs/src/bin/preview1_poll_oneoff_stdio.rs b/crates/test-programs/src/bin/p1_poll_oneoff_stdio.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_poll_oneoff_stdio.rs
rename to crates/test-programs/src/bin/p1_poll_oneoff_stdio.rs
diff --git a/crates/test-programs/src/bin/preview1_readlink.rs b/crates/test-programs/src/bin/p1_readlink.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_readlink.rs
rename to crates/test-programs/src/bin/p1_readlink.rs
diff --git a/crates/test-programs/src/bin/preview1_regular_file_isatty.rs b/crates/test-programs/src/bin/p1_regular_file_isatty.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_regular_file_isatty.rs
rename to crates/test-programs/src/bin/p1_regular_file_isatty.rs
diff --git a/crates/test-programs/src/bin/preview1_remove_directory.rs b/crates/test-programs/src/bin/p1_remove_directory.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_remove_directory.rs
rename to crates/test-programs/src/bin/p1_remove_directory.rs
diff --git a/crates/test-programs/src/bin/preview1_remove_nonempty_directory.rs b/crates/test-programs/src/bin/p1_remove_nonempty_directory.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_remove_nonempty_directory.rs
rename to crates/test-programs/src/bin/p1_remove_nonempty_directory.rs
diff --git a/crates/test-programs/src/bin/preview1_renumber.rs b/crates/test-programs/src/bin/p1_renumber.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_renumber.rs
rename to crates/test-programs/src/bin/p1_renumber.rs
diff --git a/crates/test-programs/src/bin/preview1_sched_yield.rs b/crates/test-programs/src/bin/p1_sched_yield.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_sched_yield.rs
rename to crates/test-programs/src/bin/p1_sched_yield.rs
diff --git a/crates/test-programs/src/bin/preview1_stdio.rs b/crates/test-programs/src/bin/p1_stdio.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_stdio.rs
rename to crates/test-programs/src/bin/p1_stdio.rs
diff --git a/crates/test-programs/src/bin/preview1_stdio_isatty.rs b/crates/test-programs/src/bin/p1_stdio_isatty.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_stdio_isatty.rs
rename to crates/test-programs/src/bin/p1_stdio_isatty.rs
diff --git a/crates/test-programs/src/bin/preview1_stdio_not_isatty.rs b/crates/test-programs/src/bin/p1_stdio_not_isatty.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_stdio_not_isatty.rs
rename to crates/test-programs/src/bin/p1_stdio_not_isatty.rs
diff --git a/crates/test-programs/src/bin/preview1_symlink_create.rs b/crates/test-programs/src/bin/p1_symlink_create.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_symlink_create.rs
rename to crates/test-programs/src/bin/p1_symlink_create.rs
diff --git a/crates/test-programs/src/bin/preview1_symlink_filestat.rs b/crates/test-programs/src/bin/p1_symlink_filestat.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_symlink_filestat.rs
rename to crates/test-programs/src/bin/p1_symlink_filestat.rs
diff --git a/crates/test-programs/src/bin/preview1_symlink_loop.rs b/crates/test-programs/src/bin/p1_symlink_loop.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_symlink_loop.rs
rename to crates/test-programs/src/bin/p1_symlink_loop.rs
diff --git a/crates/test-programs/src/bin/preview1_unicode_output.rs b/crates/test-programs/src/bin/p1_unicode_output.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_unicode_output.rs
rename to crates/test-programs/src/bin/p1_unicode_output.rs
diff --git a/crates/test-programs/src/bin/preview1_unlink_file_trailing_slashes.rs b/crates/test-programs/src/bin/p1_unlink_file_trailing_slashes.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview1_unlink_file_trailing_slashes.rs
rename to crates/test-programs/src/bin/p1_unlink_file_trailing_slashes.rs
diff --git a/crates/test-programs/src/bin/preview2_adapter_badfd.rs b/crates/test-programs/src/bin/p2_adapter_badfd.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_adapter_badfd.rs
rename to crates/test-programs/src/bin/p2_adapter_badfd.rs
diff --git a/crates/test-programs/src/bin/api_proxy.rs b/crates/test-programs/src/bin/p2_api_proxy.rs
similarity index 100%
rename from crates/test-programs/src/bin/api_proxy.rs
rename to crates/test-programs/src/bin/p2_api_proxy.rs
diff --git a/crates/test-programs/src/bin/api_proxy_forward_request.rs b/crates/test-programs/src/bin/p2_api_proxy_forward_request.rs
similarity index 100%
rename from crates/test-programs/src/bin/api_proxy_forward_request.rs
rename to crates/test-programs/src/bin/p2_api_proxy_forward_request.rs
diff --git a/crates/test-programs/src/bin/api_proxy_streaming.rs b/crates/test-programs/src/bin/p2_api_proxy_streaming.rs
similarity index 100%
rename from crates/test-programs/src/bin/api_proxy_streaming.rs
rename to crates/test-programs/src/bin/p2_api_proxy_streaming.rs
diff --git a/crates/test-programs/src/bin/api_reactor.rs b/crates/test-programs/src/bin/p2_api_reactor.rs
similarity index 100%
rename from crates/test-programs/src/bin/api_reactor.rs
rename to crates/test-programs/src/bin/p2_api_reactor.rs
diff --git a/crates/test-programs/src/bin/api_read_only.rs b/crates/test-programs/src/bin/p2_api_read_only.rs
similarity index 100%
rename from crates/test-programs/src/bin/api_read_only.rs
rename to crates/test-programs/src/bin/p2_api_read_only.rs
diff --git a/crates/test-programs/src/bin/api_time.rs b/crates/test-programs/src/bin/p2_api_time.rs
similarity index 100%
rename from crates/test-programs/src/bin/api_time.rs
rename to crates/test-programs/src/bin/p2_api_time.rs
diff --git a/crates/test-programs/src/bin/cli_args.rs b/crates/test-programs/src/bin/p2_cli_args.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_args.rs
rename to crates/test-programs/src/bin/p2_cli_args.rs
diff --git a/crates/test-programs/src/bin/cli_argv0.rs b/crates/test-programs/src/bin/p2_cli_argv0.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_argv0.rs
rename to crates/test-programs/src/bin/p2_cli_argv0.rs
diff --git a/crates/test-programs/src/bin/cli_default_clocks.rs b/crates/test-programs/src/bin/p2_cli_default_clocks.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_default_clocks.rs
rename to crates/test-programs/src/bin/p2_cli_default_clocks.rs
diff --git a/crates/test-programs/src/bin/cli_directory_list.rs b/crates/test-programs/src/bin/p2_cli_directory_list.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_directory_list.rs
rename to crates/test-programs/src/bin/p2_cli_directory_list.rs
diff --git a/crates/test-programs/src/bin/cli_env.rs b/crates/test-programs/src/bin/p2_cli_env.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_env.rs
rename to crates/test-programs/src/bin/p2_cli_env.rs
diff --git a/crates/test-programs/src/bin/cli_exit_default.rs b/crates/test-programs/src/bin/p2_cli_exit_default.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_exit_default.rs
rename to crates/test-programs/src/bin/p2_cli_exit_default.rs
diff --git a/crates/test-programs/src/bin/cli_exit_failure.rs b/crates/test-programs/src/bin/p2_cli_exit_failure.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_exit_failure.rs
rename to crates/test-programs/src/bin/p2_cli_exit_failure.rs
diff --git a/crates/test-programs/src/bin/cli_exit_panic.rs b/crates/test-programs/src/bin/p2_cli_exit_panic.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_exit_panic.rs
rename to crates/test-programs/src/bin/p2_cli_exit_panic.rs
diff --git a/crates/test-programs/src/bin/cli_exit_success.rs b/crates/test-programs/src/bin/p2_cli_exit_success.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_exit_success.rs
rename to crates/test-programs/src/bin/p2_cli_exit_success.rs
diff --git a/crates/test-programs/src/bin/cli_exit_with_code.rs b/crates/test-programs/src/bin/p2_cli_exit_with_code.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_exit_with_code.rs
rename to crates/test-programs/src/bin/p2_cli_exit_with_code.rs
diff --git a/crates/test-programs/src/bin/cli_export_cabi_realloc.rs b/crates/test-programs/src/bin/p2_cli_export_cabi_realloc.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_export_cabi_realloc.rs
rename to crates/test-programs/src/bin/p2_cli_export_cabi_realloc.rs
diff --git a/crates/test-programs/src/bin/cli_file_append.rs b/crates/test-programs/src/bin/p2_cli_file_append.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_file_append.rs
rename to crates/test-programs/src/bin/p2_cli_file_append.rs
diff --git a/crates/test-programs/src/bin/cli_file_dir_sync.rs b/crates/test-programs/src/bin/p2_cli_file_dir_sync.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_file_dir_sync.rs
rename to crates/test-programs/src/bin/p2_cli_file_dir_sync.rs
diff --git a/crates/test-programs/src/bin/cli_file_read.rs b/crates/test-programs/src/bin/p2_cli_file_read.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_file_read.rs
rename to crates/test-programs/src/bin/p2_cli_file_read.rs
diff --git a/crates/test-programs/src/bin/cli_hello_stdout.rs b/crates/test-programs/src/bin/p2_cli_hello_stdout.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_hello_stdout.rs
rename to crates/test-programs/src/bin/p2_cli_hello_stdout.rs
diff --git a/crates/test-programs/src/bin/cli_invoke_async.rs b/crates/test-programs/src/bin/p2_cli_invoke_async.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_invoke_async.rs
rename to crates/test-programs/src/bin/p2_cli_invoke_async.rs
diff --git a/crates/test-programs/src/bin/cli_large_env.rs b/crates/test-programs/src/bin/p2_cli_large_env.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_large_env.rs
rename to crates/test-programs/src/bin/p2_cli_large_env.rs
diff --git a/crates/test-programs/src/bin/cli_p2_much_stdout.rs b/crates/test-programs/src/bin/p2_cli_much_stdout.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_p2_much_stdout.rs
rename to crates/test-programs/src/bin/p2_cli_much_stdout.rs
diff --git a/crates/test-programs/src/bin/cli_multiple_preopens.rs b/crates/test-programs/src/bin/p2_cli_multiple_preopens.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_multiple_preopens.rs
rename to crates/test-programs/src/bin/p2_cli_multiple_preopens.rs
diff --git a/crates/test-programs/src/bin/cli_no_ip_name_lookup.rs b/crates/test-programs/src/bin/p2_cli_no_ip_name_lookup.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_no_ip_name_lookup.rs
rename to crates/test-programs/src/bin/p2_cli_no_ip_name_lookup.rs
diff --git a/crates/test-programs/src/bin/cli_no_tcp.rs b/crates/test-programs/src/bin/p2_cli_no_tcp.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_no_tcp.rs
rename to crates/test-programs/src/bin/p2_cli_no_tcp.rs
diff --git a/crates/test-programs/src/bin/cli_no_udp.rs b/crates/test-programs/src/bin/p2_cli_no_udp.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_no_udp.rs
rename to crates/test-programs/src/bin/p2_cli_no_udp.rs
diff --git a/crates/test-programs/src/bin/cli_serve_authority_and_scheme.rs b/crates/test-programs/src/bin/p2_cli_serve_authority_and_scheme.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_authority_and_scheme.rs
rename to crates/test-programs/src/bin/p2_cli_serve_authority_and_scheme.rs
diff --git a/crates/test-programs/src/bin/cli_serve_config.rs b/crates/test-programs/src/bin/p2_cli_serve_config.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_config.rs
rename to crates/test-programs/src/bin/p2_cli_serve_config.rs
diff --git a/crates/test-programs/src/bin/cli_serve_echo_env.rs b/crates/test-programs/src/bin/p2_cli_serve_echo_env.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_echo_env.rs
rename to crates/test-programs/src/bin/p2_cli_serve_echo_env.rs
diff --git a/crates/test-programs/src/bin/cli_serve_keyvalue.rs b/crates/test-programs/src/bin/p2_cli_serve_keyvalue.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_keyvalue.rs
rename to crates/test-programs/src/bin/p2_cli_serve_keyvalue.rs
diff --git a/crates/test-programs/src/bin/cli_serve_return_before_set.rs b/crates/test-programs/src/bin/p2_cli_serve_return_before_set.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_return_before_set.rs
rename to crates/test-programs/src/bin/p2_cli_serve_return_before_set.rs
diff --git a/crates/test-programs/src/bin/cli_serve_sleep.rs b/crates/test-programs/src/bin/p2_cli_serve_sleep.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_sleep.rs
rename to crates/test-programs/src/bin/p2_cli_serve_sleep.rs
diff --git a/crates/test-programs/src/bin/cli_serve_trap_before_set.rs b/crates/test-programs/src/bin/p2_cli_serve_trap_before_set.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_trap_before_set.rs
rename to crates/test-programs/src/bin/p2_cli_serve_trap_before_set.rs
diff --git a/crates/test-programs/src/bin/cli_serve_with_print.rs b/crates/test-programs/src/bin/p2_cli_serve_with_print.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_with_print.rs
rename to crates/test-programs/src/bin/p2_cli_serve_with_print.rs
diff --git a/crates/test-programs/src/bin/cli_sleep.rs b/crates/test-programs/src/bin/p2_cli_sleep.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_sleep.rs
rename to crates/test-programs/src/bin/p2_cli_sleep.rs
diff --git a/crates/test-programs/src/bin/cli_sleep_forever.rs b/crates/test-programs/src/bin/p2_cli_sleep_forever.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_sleep_forever.rs
rename to crates/test-programs/src/bin/p2_cli_sleep_forever.rs
diff --git a/crates/test-programs/src/bin/cli_splice_stdin.rs b/crates/test-programs/src/bin/p2_cli_splice_stdin.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_splice_stdin.rs
rename to crates/test-programs/src/bin/p2_cli_splice_stdin.rs
diff --git a/crates/test-programs/src/bin/cli_stdin.rs b/crates/test-programs/src/bin/p2_cli_stdin.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_stdin.rs
rename to crates/test-programs/src/bin/p2_cli_stdin.rs
diff --git a/crates/test-programs/src/bin/cli_stdin_empty.rs b/crates/test-programs/src/bin/p2_cli_stdin_empty.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_stdin_empty.rs
rename to crates/test-programs/src/bin/p2_cli_stdin_empty.rs
diff --git a/crates/test-programs/src/bin/cli_stdio_write_flushes.rs b/crates/test-programs/src/bin/p2_cli_stdio_write_flushes.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_stdio_write_flushes.rs
rename to crates/test-programs/src/bin/p2_cli_stdio_write_flushes.rs
diff --git a/crates/test-programs/src/bin/preview2_file_read_write.rs b/crates/test-programs/src/bin/p2_file_read_write.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_file_read_write.rs
rename to crates/test-programs/src/bin/p2_file_read_write.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_content_length.rs b/crates/test-programs/src/bin/p2_http_outbound_request_content_length.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_content_length.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_content_length.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_get.rs b/crates/test-programs/src/bin/p2_http_outbound_request_get.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_get.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_get.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_invalid_dnsname.rs b/crates/test-programs/src/bin/p2_http_outbound_request_invalid_dnsname.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_invalid_dnsname.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_invalid_dnsname.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_invalid_header.rs b/crates/test-programs/src/bin/p2_http_outbound_request_invalid_header.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_invalid_header.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_invalid_header.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_invalid_port.rs b/crates/test-programs/src/bin/p2_http_outbound_request_invalid_port.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_invalid_port.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_invalid_port.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_invalid_version.rs b/crates/test-programs/src/bin/p2_http_outbound_request_invalid_version.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_invalid_version.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_invalid_version.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_large_post.rs b/crates/test-programs/src/bin/p2_http_outbound_request_large_post.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_large_post.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_large_post.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_missing_path_and_query.rs b/crates/test-programs/src/bin/p2_http_outbound_request_missing_path_and_query.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_missing_path_and_query.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_missing_path_and_query.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_post.rs b/crates/test-programs/src/bin/p2_http_outbound_request_post.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_post.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_post.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_put.rs b/crates/test-programs/src/bin/p2_http_outbound_request_put.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_put.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_put.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_response_build.rs b/crates/test-programs/src/bin/p2_http_outbound_request_response_build.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_response_build.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_response_build.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_timeout.rs b/crates/test-programs/src/bin/p2_http_outbound_request_timeout.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_timeout.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_timeout.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_unknown_method.rs b/crates/test-programs/src/bin/p2_http_outbound_request_unknown_method.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_unknown_method.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_unknown_method.rs
diff --git a/crates/test-programs/src/bin/http_outbound_request_unsupported_scheme.rs b/crates/test-programs/src/bin/p2_http_outbound_request_unsupported_scheme.rs
similarity index 100%
rename from crates/test-programs/src/bin/http_outbound_request_unsupported_scheme.rs
rename to crates/test-programs/src/bin/p2_http_outbound_request_unsupported_scheme.rs
diff --git a/crates/test-programs/src/bin/preview2_ip_name_lookup.rs b/crates/test-programs/src/bin/p2_ip_name_lookup.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_ip_name_lookup.rs
rename to crates/test-programs/src/bin/p2_ip_name_lookup.rs
diff --git a/crates/test-programs/src/bin/preview2_pollable_correct.rs b/crates/test-programs/src/bin/p2_pollable_correct.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_pollable_correct.rs
rename to crates/test-programs/src/bin/p2_pollable_correct.rs
diff --git a/crates/test-programs/src/bin/preview2_pollable_traps.rs b/crates/test-programs/src/bin/p2_pollable_traps.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_pollable_traps.rs
rename to crates/test-programs/src/bin/p2_pollable_traps.rs
diff --git a/crates/test-programs/src/bin/preview2_random.rs b/crates/test-programs/src/bin/p2_random.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_random.rs
rename to crates/test-programs/src/bin/p2_random.rs
diff --git a/crates/test-programs/src/bin/preview2_sleep.rs b/crates/test-programs/src/bin/p2_sleep.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_sleep.rs
rename to crates/test-programs/src/bin/p2_sleep.rs
diff --git a/crates/test-programs/src/bin/preview2_stream_pollable_correct.rs b/crates/test-programs/src/bin/p2_stream_pollable_correct.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_stream_pollable_correct.rs
rename to crates/test-programs/src/bin/p2_stream_pollable_correct.rs
diff --git a/crates/test-programs/src/bin/preview2_stream_pollable_traps.rs b/crates/test-programs/src/bin/p2_stream_pollable_traps.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_stream_pollable_traps.rs
rename to crates/test-programs/src/bin/p2_stream_pollable_traps.rs
diff --git a/crates/test-programs/src/bin/preview2_tcp_bind.rs b/crates/test-programs/src/bin/p2_tcp_bind.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_tcp_bind.rs
rename to crates/test-programs/src/bin/p2_tcp_bind.rs
diff --git a/crates/test-programs/src/bin/preview2_tcp_connect.rs b/crates/test-programs/src/bin/p2_tcp_connect.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_tcp_connect.rs
rename to crates/test-programs/src/bin/p2_tcp_connect.rs
diff --git a/crates/test-programs/src/bin/preview2_tcp_sample_application.rs b/crates/test-programs/src/bin/p2_tcp_sample_application.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_tcp_sample_application.rs
rename to crates/test-programs/src/bin/p2_tcp_sample_application.rs
diff --git a/crates/test-programs/src/bin/preview2_tcp_sockopts.rs b/crates/test-programs/src/bin/p2_tcp_sockopts.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_tcp_sockopts.rs
rename to crates/test-programs/src/bin/p2_tcp_sockopts.rs
diff --git a/crates/test-programs/src/bin/preview2_tcp_states.rs b/crates/test-programs/src/bin/p2_tcp_states.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_tcp_states.rs
rename to crates/test-programs/src/bin/p2_tcp_states.rs
diff --git a/crates/test-programs/src/bin/preview2_tcp_streams.rs b/crates/test-programs/src/bin/p2_tcp_streams.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_tcp_streams.rs
rename to crates/test-programs/src/bin/p2_tcp_streams.rs
diff --git a/crates/test-programs/src/bin/preview2_udp_bind.rs b/crates/test-programs/src/bin/p2_udp_bind.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_udp_bind.rs
rename to crates/test-programs/src/bin/p2_udp_bind.rs
diff --git a/crates/test-programs/src/bin/preview2_udp_connect.rs b/crates/test-programs/src/bin/p2_udp_connect.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_udp_connect.rs
rename to crates/test-programs/src/bin/p2_udp_connect.rs
diff --git a/crates/test-programs/src/bin/preview2_udp_sample_application.rs b/crates/test-programs/src/bin/p2_udp_sample_application.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_udp_sample_application.rs
rename to crates/test-programs/src/bin/p2_udp_sample_application.rs
diff --git a/crates/test-programs/src/bin/preview2_udp_sockopts.rs b/crates/test-programs/src/bin/p2_udp_sockopts.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_udp_sockopts.rs
rename to crates/test-programs/src/bin/p2_udp_sockopts.rs
diff --git a/crates/test-programs/src/bin/preview2_udp_states.rs b/crates/test-programs/src/bin/p2_udp_states.rs
similarity index 100%
rename from crates/test-programs/src/bin/preview2_udp_states.rs
rename to crates/test-programs/src/bin/p2_udp_states.rs
diff --git a/crates/test-programs/src/bin/cli_p3_hello_stdout.rs b/crates/test-programs/src/bin/p3_cli_hello_stdout.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_p3_hello_stdout.rs
rename to crates/test-programs/src/bin/p3_cli_hello_stdout.rs
diff --git a/crates/test-programs/src/bin/cli_p3_much_stdout.rs b/crates/test-programs/src/bin/p3_cli_much_stdout.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_p3_much_stdout.rs
rename to crates/test-programs/src/bin/p3_cli_much_stdout.rs
diff --git a/crates/test-programs/src/bin/cli_serve_p3_hello_world.rs b/crates/test-programs/src/bin/p3_cli_serve_hello_world.rs
similarity index 100%
rename from crates/test-programs/src/bin/cli_serve_p3_hello_world.rs
rename to crates/test-programs/src/bin/p3_cli_serve_hello_world.rs
diff --git a/crates/wasi-common/tests/all/async_.rs b/crates/wasi-common/tests/all/async_.rs
index 02ad3430c8..115059d021 100644
--- a/crates/wasi-common/tests/all/async_.rs
+++ b/crates/wasi-common/tests/all/async_.rs
@@ -3,7 +3,7 @@ use test_programs_artifacts::*;
use wasi_common::WasiCtx;
use wasi_common::tokio::{WasiCtxBuilder, add_to_linker};
-foreach_preview1!(assert_test_exists);
+foreach_p1!(assert_test_exists);
pub fn prepare_workspace(exe_name: &str) -> Result<TempDir> {
let prefix = format!("wasi_tokio_{exe_name}_");
@@ -77,219 +77,221 @@ async fn run(path: &str, inherit_stdio: bool) -> Result<()> {
// Below here is mechanical: there should be one test for every binary in
// wasi-tests.
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_big_random_buf() {
- run(PREVIEW1_BIG_RANDOM_BUF, true).await.unwrap()
+async fn p1_big_random_buf() {
+ run(P1_BIG_RANDOM_BUF, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_clock_time_get() {
- run(PREVIEW1_CLOCK_TIME_GET, true).await.unwrap()
+async fn p1_clock_time_get() {
+ run(P1_CLOCK_TIME_GET, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_close_preopen() {
- run(PREVIEW1_CLOSE_PREOPEN, true).await.unwrap()
+async fn p1_close_preopen() {
+ run(P1_CLOSE_PREOPEN, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dangling_fd() {
- run(PREVIEW1_DANGLING_FD, true).await.unwrap()
+async fn p1_dangling_fd() {
+ run(P1_DANGLING_FD, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dangling_symlink() {
- run(PREVIEW1_DANGLING_SYMLINK, true).await.unwrap()
+async fn p1_dangling_symlink() {
+ run(P1_DANGLING_SYMLINK, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_directory_seek() {
- run(PREVIEW1_DIRECTORY_SEEK, true).await.unwrap()
+async fn p1_directory_seek() {
+ run(P1_DIRECTORY_SEEK, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dir_fd_op_failures() {
- run(PREVIEW1_DIR_FD_OP_FAILURES, true).await.unwrap()
+async fn p1_dir_fd_op_failures() {
+ run(P1_DIR_FD_OP_FAILURES, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_advise() {
- run(PREVIEW1_FD_ADVISE, true).await.unwrap()
+async fn p1_fd_advise() {
+ run(P1_FD_ADVISE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_filestat_get() {
- run(PREVIEW1_FD_FILESTAT_GET, true).await.unwrap()
+async fn p1_fd_filestat_get() {
+ run(P1_FD_FILESTAT_GET, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_filestat_set() {
- run(PREVIEW1_FD_FILESTAT_SET, true).await.unwrap()
+async fn p1_fd_filestat_set() {
+ run(P1_FD_FILESTAT_SET, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_flags_set() {
- run(PREVIEW1_FD_FLAGS_SET, true).await.unwrap()
+async fn p1_fd_flags_set() {
+ run(P1_FD_FLAGS_SET, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_readdir() {
- run(PREVIEW1_FD_READDIR, true).await.unwrap()
+async fn p1_fd_readdir() {
+ run(P1_FD_READDIR, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_allocate() {
- run(PREVIEW1_FILE_ALLOCATE, true).await.unwrap()
+async fn p1_file_allocate() {
+ run(P1_FILE_ALLOCATE, true).await.unwrap()
}
// see sync.rs for notes about ignores here
#[test_log::test(tokio::test(flavor = "multi_thread"))]
#[cfg_attr(not(target_os = "linux"), ignore)]
-async fn preview1_file_pread_pwrite() {
- run(PREVIEW1_FILE_PREAD_PWRITE, true).await.unwrap()
+async fn p1_file_pread_pwrite() {
+ run(P1_FILE_PREAD_PWRITE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_read_write() {
- run(PREVIEW1_FILE_READ_WRITE, true).await.unwrap()
+async fn p1_file_read_write() {
+ run(P1_FILE_READ_WRITE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_seek_tell() {
- run(PREVIEW1_FILE_SEEK_TELL, true).await.unwrap()
+async fn p1_file_seek_tell() {
+ run(P1_FILE_SEEK_TELL, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_truncation() {
- run(PREVIEW1_FILE_TRUNCATION, true).await.unwrap()
+async fn p1_file_truncation() {
+ run(P1_FILE_TRUNCATION, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_unbuffered_write() {
- run(PREVIEW1_FILE_UNBUFFERED_WRITE, true).await.unwrap()
+async fn p1_file_unbuffered_write() {
+ run(P1_FILE_UNBUFFERED_WRITE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_interesting_paths() {
- run(PREVIEW1_INTERESTING_PATHS, true).await.unwrap()
+async fn p1_interesting_paths() {
+ run(P1_INTERESTING_PATHS, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_regular_file_isatty() {
- run(PREVIEW1_REGULAR_FILE_ISATTY, false).await.unwrap()
+async fn p1_regular_file_isatty() {
+ run(P1_REGULAR_FILE_ISATTY, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_nofollow_errors() {
- run(PREVIEW1_NOFOLLOW_ERRORS, true).await.unwrap()
+async fn p1_nofollow_errors() {
+ run(P1_NOFOLLOW_ERRORS, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_overwrite_preopen() {
- run(PREVIEW1_OVERWRITE_PREOPEN, true).await.unwrap()
+async fn p1_overwrite_preopen() {
+ run(P1_OVERWRITE_PREOPEN, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_exists() {
- run(PREVIEW1_PATH_EXISTS, true).await.unwrap()
+async fn p1_path_exists() {
+ run(P1_PATH_EXISTS, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_filestat() {
- run(PREVIEW1_PATH_FILESTAT, true).await.unwrap()
+async fn p1_path_filestat() {
+ run(P1_PATH_FILESTAT, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_link() {
- run(PREVIEW1_PATH_LINK, true).await.unwrap()
+async fn p1_path_link() {
+ run(P1_PATH_LINK, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_create_existing() {
- run(PREVIEW1_PATH_OPEN_CREATE_EXISTING, true).await.unwrap()
+async fn p1_path_open_create_existing() {
+ run(P1_PATH_OPEN_CREATE_EXISTING, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_read_write() {
- run(PREVIEW1_PATH_OPEN_READ_WRITE, true).await.unwrap()
+async fn p1_path_open_read_write() {
+ run(P1_PATH_OPEN_READ_WRITE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_dirfd_not_dir() {
- run(PREVIEW1_PATH_OPEN_DIRFD_NOT_DIR, true).await.unwrap()
+async fn p1_path_open_dirfd_not_dir() {
+ run(P1_PATH_OPEN_DIRFD_NOT_DIR, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_missing() {
- run(PREVIEW1_PATH_OPEN_MISSING, true).await.unwrap()
+async fn p1_path_open_missing() {
+ run(P1_PATH_OPEN_MISSING, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_nonblock() {
- run(PREVIEW1_PATH_OPEN_NONBLOCK, true).await.unwrap()
+async fn p1_path_open_nonblock() {
+ run(P1_PATH_OPEN_NONBLOCK, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_rename_dir_trailing_slashes() {
- run(PREVIEW1_PATH_RENAME_DIR_TRAILING_SLASHES, true)
+async fn p1_path_rename_dir_trailing_slashes() {
+ run(P1_PATH_RENAME_DIR_TRAILING_SLASHES, true)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_rename() {
- run(PREVIEW1_PATH_RENAME, true).await.unwrap()
+async fn p1_path_rename() {
+ run(P1_PATH_RENAME, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_symlink_trailing_slashes() {
- run(PREVIEW1_PATH_SYMLINK_TRAILING_SLASHES, true)
- .await
- .unwrap()
+async fn p1_path_symlink_trailing_slashes() {
+ run(P1_PATH_SYMLINK_TRAILING_SLASHES, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_poll_oneoff_files() {
- run(PREVIEW1_POLL_ONEOFF_FILES, false).await.unwrap()
+async fn p1_poll_oneoff_files() {
+ run(P1_POLL_ONEOFF_FILES, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_poll_oneoff_stdio() {
- run(PREVIEW1_POLL_ONEOFF_STDIO, true).await.unwrap()
+async fn p1_poll_oneoff_stdio() {
+ run(P1_POLL_ONEOFF_STDIO, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_readlink() {
- run(PREVIEW1_READLINK, true).await.unwrap()
+async fn p1_readlink() {
+ run(P1_READLINK, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_remove_directory() {
- run(PREVIEW1_REMOVE_DIRECTORY, true).await.unwrap()
+async fn p1_remove_directory() {
+ run(P1_REMOVE_DIRECTORY, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_remove_nonempty_directory() {
- run(PREVIEW1_REMOVE_NONEMPTY_DIRECTORY, true).await.unwrap()
+async fn p1_remove_nonempty_directory() {
+ run(P1_REMOVE_NONEMPTY_DIRECTORY, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_renumber() {
- run(PREVIEW1_RENUMBER, true).await.unwrap()
+async fn p1_renumber() {
+ run(P1_RENUMBER, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_sched_yield() {
- run(PREVIEW1_SCHED_YIELD, true).await.unwrap()
+async fn p1_sched_yield() {
+ run(P1_SCHED_YIELD, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio() {
- run(PREVIEW1_STDIO, true).await.unwrap()
+async fn p1_stdio() {
+ run(P1_STDIO, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio_isatty() {
+async fn p1_stdio_isatty() {
// Only a valid test if the host executable's stdio is a terminal:
if test_programs_artifacts::stdio_is_terminal() {
// Inherit stdio, test asserts it is a tty:
- run(PREVIEW1_STDIO_ISATTY, true).await.unwrap()
+ run(P1_STDIO_ISATTY, true).await.unwrap()
}
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio_not_isatty() {
+async fn p1_stdio_not_isatty() {
// Don't inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_NOT_ISATTY, false).await.unwrap()
+ run(P1_STDIO_NOT_ISATTY, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_create() {
- run(PREVIEW1_SYMLINK_CREATE, true).await.unwrap()
+async fn p1_symlink_create() {
+ run(P1_SYMLINK_CREATE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_filestat() {
- run(PREVIEW1_SYMLINK_FILESTAT, true).await.unwrap()
+async fn p1_symlink_filestat() {
+ run(P1_SYMLINK_FILESTAT, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_loop() {
- run(PREVIEW1_SYMLINK_LOOP, true).await.unwrap()
+async fn p1_symlink_loop() {
+ run(P1_SYMLINK_LOOP, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_unlink_file_trailing_slashes() {
- run(PREVIEW1_UNLINK_FILE_TRAILING_SLASHES, true)
- .await
- .unwrap()
+async fn p1_unlink_file_trailing_slashes() {
+ run(P1_UNLINK_FILE_TRAILING_SLASHES, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_preopen() {
- run(PREVIEW1_PATH_OPEN_PREOPEN, true).await.unwrap()
+async fn p1_path_open_preopen() {
+ run(P1_PATH_OPEN_PREOPEN, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_unicode_output() {
- run(PREVIEW1_UNICODE_OUTPUT, true).await.unwrap()
+async fn p1_unicode_output() {
+ run(P1_UNICODE_OUTPUT, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_write() {
- run(PREVIEW1_FILE_WRITE, true).await.unwrap()
+async fn p1_file_write() {
+ run(P1_FILE_WRITE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_lots() {
- run(PREVIEW1_PATH_OPEN_LOTS, true).await.unwrap()
+async fn p1_path_open_lots() {
+ run(P1_PATH_OPEN_LOTS, true).await.unwrap()
}
+
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p1_cli_much_stdout() {}
diff --git a/crates/wasi-common/tests/all/sync.rs b/crates/wasi-common/tests/all/sync.rs
index b9980faa1c..4245cf8d4d 100644
--- a/crates/wasi-common/tests/all/sync.rs
+++ b/crates/wasi-common/tests/all/sync.rs
@@ -2,7 +2,7 @@ use super::*;
use test_programs_artifacts::*;
use wasi_common::sync::{WasiCtxBuilder, add_to_linker};
-foreach_preview1!(assert_test_exists);
+foreach_p1!(assert_test_exists);
fn run(path: &str, inherit_stdio: bool) -> Result<()> {
let path = Path::new(path);
@@ -68,56 +68,56 @@ fn run(path: &str, inherit_stdio: bool) -> Result<()> {
// Below here is mechanical: there should be one test for every binary in
// wasi-tests.
#[test_log::test]
-fn preview1_big_random_buf() {
- run(PREVIEW1_BIG_RANDOM_BUF, true).unwrap()
+fn p1_big_random_buf() {
+ run(P1_BIG_RANDOM_BUF, true).unwrap()
}
#[test_log::test]
-fn preview1_clock_time_get() {
- run(PREVIEW1_CLOCK_TIME_GET, true).unwrap()
+fn p1_clock_time_get() {
+ run(P1_CLOCK_TIME_GET, true).unwrap()
}
#[test_log::test]
-fn preview1_close_preopen() {
- run(PREVIEW1_CLOSE_PREOPEN, true).unwrap()
+fn p1_close_preopen() {
+ run(P1_CLOSE_PREOPEN, true).unwrap()
}
#[test_log::test]
-fn preview1_dangling_fd() {
- run(PREVIEW1_DANGLING_FD, true).unwrap()
+fn p1_dangling_fd() {
+ run(P1_DANGLING_FD, true).unwrap()
}
#[test_log::test]
-fn preview1_dangling_symlink() {
- run(PREVIEW1_DANGLING_SYMLINK, true).unwrap()
+fn p1_dangling_symlink() {
+ run(P1_DANGLING_SYMLINK, true).unwrap()
}
#[test_log::test]
-fn preview1_directory_seek() {
- run(PREVIEW1_DIRECTORY_SEEK, true).unwrap()
+fn p1_directory_seek() {
+ run(P1_DIRECTORY_SEEK, true).unwrap()
}
#[test_log::test]
-fn preview1_dir_fd_op_failures() {
- run(PREVIEW1_DIR_FD_OP_FAILURES, true).unwrap()
+fn p1_dir_fd_op_failures() {
+ run(P1_DIR_FD_OP_FAILURES, true).unwrap()
}
#[test_log::test]
-fn preview1_fd_advise() {
- run(PREVIEW1_FD_ADVISE, true).unwrap()
+fn p1_fd_advise() {
+ run(P1_FD_ADVISE, true).unwrap()
}
#[test_log::test]
-fn preview1_fd_filestat_get() {
- run(PREVIEW1_FD_FILESTAT_GET, true).unwrap()
+fn p1_fd_filestat_get() {
+ run(P1_FD_FILESTAT_GET, true).unwrap()
}
#[test_log::test]
-fn preview1_fd_filestat_set() {
- run(PREVIEW1_FD_FILESTAT_SET, true).unwrap()
+fn p1_fd_filestat_set() {
+ run(P1_FD_FILESTAT_SET, true).unwrap()
}
#[test_log::test]
-fn preview1_fd_flags_set() {
- run(PREVIEW1_FD_FLAGS_SET, true).unwrap()
+fn p1_fd_flags_set() {
+ run(P1_FD_FLAGS_SET, true).unwrap()
}
#[test_log::test]
-fn preview1_fd_readdir() {
- run(PREVIEW1_FD_READDIR, true).unwrap()
+fn p1_fd_readdir() {
+ run(P1_FD_READDIR, true).unwrap()
}
#[test_log::test]
-fn preview1_file_allocate() {
- run(PREVIEW1_FILE_ALLOCATE, true).unwrap()
+fn p1_file_allocate() {
+ run(P1_FILE_ALLOCATE, true).unwrap()
}
// This test is outside of linux because the behavior of `pwrite`, which this
// test bottoms out into, differs across platforms. The wasi-common crate
@@ -125,159 +125,165 @@ fn preview1_file_allocate() {
// flag easily, but `wasmtime-wasi` has the "correct" behavior here.
#[test_log::test]
#[cfg_attr(not(target_os = "linux"), ignore)]
-fn preview1_file_pread_pwrite() {
- run(PREVIEW1_FILE_PREAD_PWRITE, true).unwrap()
+fn p1_file_pread_pwrite() {
+ run(P1_FILE_PREAD_PWRITE, true).unwrap()
}
#[test_log::test]
-fn preview1_file_read_write() {
- run(PREVIEW1_FILE_READ_WRITE, true).unwrap()
+fn p1_file_read_write() {
+ run(P1_FILE_READ_WRITE, true).unwrap()
}
#[test_log::test]
-fn preview1_file_seek_tell() {
- run(PREVIEW1_FILE_SEEK_TELL, true).unwrap()
+fn p1_file_seek_tell() {
+ run(P1_FILE_SEEK_TELL, true).unwrap()
}
#[test_log::test]
-fn preview1_file_truncation() {
- run(PREVIEW1_FILE_TRUNCATION, true).unwrap()
+fn p1_file_truncation() {
+ run(P1_FILE_TRUNCATION, true).unwrap()
}
#[test_log::test]
-fn preview1_file_unbuffered_write() {
- run(PREVIEW1_FILE_UNBUFFERED_WRITE, true).unwrap()
+fn p1_file_unbuffered_write() {
+ run(P1_FILE_UNBUFFERED_WRITE, true).unwrap()
}
#[test_log::test]
-fn preview1_interesting_paths() {
- run(PREVIEW1_INTERESTING_PATHS, true).unwrap()
+fn p1_interesting_paths() {
+ run(P1_INTERESTING_PATHS, true).unwrap()
}
#[test_log::test]
-fn preview1_regular_file_isatty() {
- run(PREVIEW1_REGULAR_FILE_ISATTY, true).unwrap()
+fn p1_regular_file_isatty() {
+ run(P1_REGULAR_FILE_ISATTY, true).unwrap()
}
#[test_log::test]
-fn preview1_nofollow_errors() {
- run(PREVIEW1_NOFOLLOW_ERRORS, true).unwrap()
+fn p1_nofollow_errors() {
+ run(P1_NOFOLLOW_ERRORS, true).unwrap()
}
#[test_log::test]
-fn preview1_overwrite_preopen() {
- run(PREVIEW1_OVERWRITE_PREOPEN, true).unwrap()
+fn p1_overwrite_preopen() {
+ run(P1_OVERWRITE_PREOPEN, true).unwrap()
}
#[test_log::test]
-fn preview1_path_exists() {
- run(PREVIEW1_PATH_EXISTS, true).unwrap()
+fn p1_path_exists() {
+ run(P1_PATH_EXISTS, true).unwrap()
}
#[test_log::test]
-fn preview1_path_filestat() {
- run(PREVIEW1_PATH_FILESTAT, true).unwrap()
+fn p1_path_filestat() {
+ run(P1_PATH_FILESTAT, true).unwrap()
}
#[test_log::test]
-fn preview1_path_link() {
- run(PREVIEW1_PATH_LINK, true).unwrap()
+fn p1_path_link() {
+ run(P1_PATH_LINK, true).unwrap()
}
#[test_log::test]
-fn preview1_path_open_create_existing() {
- run(PREVIEW1_PATH_OPEN_CREATE_EXISTING, true).unwrap()
+fn p1_path_open_create_existing() {
+ run(P1_PATH_OPEN_CREATE_EXISTING, true).unwrap()
}
#[test_log::test]
-fn preview1_path_open_read_write() {
- run(PREVIEW1_PATH_OPEN_READ_WRITE, true).unwrap()
+fn p1_path_open_read_write() {
+ run(P1_PATH_OPEN_READ_WRITE, true).unwrap()
}
#[test_log::test]
-fn preview1_path_open_dirfd_not_dir() {
- run(PREVIEW1_PATH_OPEN_DIRFD_NOT_DIR, true).unwrap()
+fn p1_path_open_dirfd_not_dir() {
+ run(P1_PATH_OPEN_DIRFD_NOT_DIR, true).unwrap()
}
#[test_log::test]
-fn preview1_path_open_missing() {
- run(PREVIEW1_PATH_OPEN_MISSING, true).unwrap()
+fn p1_path_open_missing() {
+ run(P1_PATH_OPEN_MISSING, true).unwrap()
}
#[test_log::test]
-fn preview1_path_open_nonblock() {
- run(PREVIEW1_PATH_OPEN_NONBLOCK, true).unwrap()
+fn p1_path_open_nonblock() {
+ run(P1_PATH_OPEN_NONBLOCK, true).unwrap()
}
#[test_log::test]
-fn preview1_path_rename_dir_trailing_slashes() {
- run(PREVIEW1_PATH_RENAME_DIR_TRAILING_SLASHES, true).unwrap()
+fn p1_path_rename_dir_trailing_slashes() {
+ run(P1_PATH_RENAME_DIR_TRAILING_SLASHES, true).unwrap()
}
#[test_log::test]
-fn preview1_path_rename() {
- run(PREVIEW1_PATH_RENAME, true).unwrap()
+fn p1_path_rename() {
+ run(P1_PATH_RENAME, true).unwrap()
}
#[test_log::test]
-fn preview1_path_symlink_trailing_slashes() {
- run(PREVIEW1_PATH_SYMLINK_TRAILING_SLASHES, true).unwrap()
+fn p1_path_symlink_trailing_slashes() {
+ run(P1_PATH_SYMLINK_TRAILING_SLASHES, true).unwrap()
}
#[test_log::test]
-fn preview1_poll_oneoff_files() {
- run(PREVIEW1_POLL_ONEOFF_FILES, false).unwrap()
+fn p1_poll_oneoff_files() {
+ run(P1_POLL_ONEOFF_FILES, false).unwrap()
}
#[test_log::test]
-fn preview1_poll_oneoff_stdio() {
- run(PREVIEW1_POLL_ONEOFF_STDIO, true).unwrap()
+fn p1_poll_oneoff_stdio() {
+ run(P1_POLL_ONEOFF_STDIO, true).unwrap()
}
#[test_log::test]
-fn preview1_readlink() {
- run(PREVIEW1_READLINK, true).unwrap()
+fn p1_readlink() {
+ run(P1_READLINK, true).unwrap()
}
#[test_log::test]
-fn preview1_remove_directory() {
- run(PREVIEW1_REMOVE_DIRECTORY, true).unwrap()
+fn p1_remove_directory() {
+ run(P1_REMOVE_DIRECTORY, true).unwrap()
}
#[test_log::test]
-fn preview1_remove_nonempty_directory() {
- run(PREVIEW1_REMOVE_NONEMPTY_DIRECTORY, true).unwrap()
+fn p1_remove_nonempty_directory() {
+ run(P1_REMOVE_NONEMPTY_DIRECTORY, true).unwrap()
}
#[test_log::test]
-fn preview1_renumber() {
- run(PREVIEW1_RENUMBER, true).unwrap()
+fn p1_renumber() {
+ run(P1_RENUMBER, true).unwrap()
}
#[test_log::test]
-fn preview1_sched_yield() {
- run(PREVIEW1_SCHED_YIELD, true).unwrap()
+fn p1_sched_yield() {
+ run(P1_SCHED_YIELD, true).unwrap()
}
#[test_log::test]
-fn preview1_stdio() {
- run(PREVIEW1_STDIO, true).unwrap()
+fn p1_stdio() {
+ run(P1_STDIO, true).unwrap()
}
#[test_log::test]
-fn preview1_stdio_isatty() {
+fn p1_stdio_isatty() {
if test_programs_artifacts::stdio_is_terminal() {
// Inherit stdio, which is a terminal in the test runner's environment:
- run(PREVIEW1_STDIO_ISATTY, true).unwrap()
+ run(P1_STDIO_ISATTY, true).unwrap()
}
}
#[test_log::test]
-fn preview1_stdio_not_isatty() {
+fn p1_stdio_not_isatty() {
// Don't inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_NOT_ISATTY, false).unwrap()
+ run(P1_STDIO_NOT_ISATTY, false).unwrap()
}
#[test_log::test]
-fn preview1_symlink_create() {
- run(PREVIEW1_SYMLINK_CREATE, true).unwrap()
+fn p1_symlink_create() {
+ run(P1_SYMLINK_CREATE, true).unwrap()
}
#[test_log::test]
-fn preview1_symlink_filestat() {
- run(PREVIEW1_SYMLINK_FILESTAT, true).unwrap()
+fn p1_symlink_filestat() {
+ run(P1_SYMLINK_FILESTAT, true).unwrap()
}
#[test_log::test]
-fn preview1_symlink_loop() {
- run(PREVIEW1_SYMLINK_LOOP, true).unwrap()
+fn p1_symlink_loop() {
+ run(P1_SYMLINK_LOOP, true).unwrap()
}
#[test_log::test]
-fn preview1_unlink_file_trailing_slashes() {
- run(PREVIEW1_UNLINK_FILE_TRAILING_SLASHES, true).unwrap()
+fn p1_unlink_file_trailing_slashes() {
+ run(P1_UNLINK_FILE_TRAILING_SLASHES, true).unwrap()
}
#[test_log::test]
-fn preview1_path_open_preopen() {
- run(PREVIEW1_PATH_OPEN_PREOPEN, true).unwrap()
+fn p1_path_open_preopen() {
+ run(P1_PATH_OPEN_PREOPEN, true).unwrap()
}
#[test_log::test]
-fn preview1_unicode_output() {
- run(PREVIEW1_UNICODE_OUTPUT, true).unwrap()
+fn p1_unicode_output() {
+ run(P1_UNICODE_OUTPUT, true).unwrap()
}
#[test_log::test]
-fn preview1_file_write() {
- run(PREVIEW1_FILE_WRITE, true).unwrap()
+fn p1_file_write() {
+ run(P1_FILE_WRITE, true).unwrap()
}
#[test_log::test]
-fn preview1_path_open_lots() {
- run(PREVIEW1_PATH_OPEN_LOTS, true).unwrap()
+fn p1_path_open_lots() {
+ run(P1_PATH_OPEN_LOTS, true).unwrap()
}
+
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p1_cli_much_stdout() {}
diff --git a/crates/wasi-http/tests/all/p2.rs b/crates/wasi-http/tests/all/p2.rs
index c4a631f30e..5c5b2c962b 100644
--- a/crates/wasi-http/tests/all/p2.rs
+++ b/crates/wasi-http/tests/all/p2.rs
@@ -214,7 +214,7 @@ async fn wasi_http_proxy_tests() -> anyhow::Result<()> {
.method(http::Method::GET);
let resp = run_wasi_http(
- test_programs_artifacts::API_PROXY_COMPONENT,
+ test_programs_artifacts::P2_API_PROXY_COMPONENT,
req.body(body::empty())?,
None,
None,
@@ -346,7 +346,7 @@ async fn do_wasi_http_hash_all(override_send_request: bool) -> Result<()> {
let request = request.body(body::empty())?;
let response = run_wasi_http(
- test_programs_artifacts::API_PROXY_STREAMING_COMPONENT,
+ test_programs_artifacts::P2_API_PROXY_STREAMING_COMPONENT,
request,
send_request,
None,
@@ -394,7 +394,7 @@ async fn wasi_http_hash_all_with_reject() -> Result<()> {
let request = request.body(body::empty())?;
let response = run_wasi_http(
- test_programs_artifacts::API_PROXY_STREAMING_COMPONENT,
+ test_programs_artifacts::P2_API_PROXY_STREAMING_COMPONENT,
request,
None,
Some("forbidden.com".to_string()),
@@ -514,7 +514,7 @@ async fn do_wasi_http_echo(uri: &str, url_header: Option<&str>) -> Result<()> {
))))?;
let response = run_wasi_http(
- test_programs_artifacts::API_PROXY_STREAMING_COMPONENT,
+ test_programs_artifacts::P2_API_PROXY_STREAMING_COMPONENT,
request,
None,
None,
@@ -546,7 +546,7 @@ async fn wasi_http_without_port() -> Result<()> {
.uri("https://httpbin.org/get");
let _response: hyper::Response<_> = run_wasi_http(
- test_programs_artifacts::API_PROXY_FORWARD_REQUEST_COMPONENT,
+ test_programs_artifacts::P2_API_PROXY_FORWARD_REQUEST_COMPONENT,
req.body(body::empty())?,
None,
None,
@@ -569,7 +569,7 @@ async fn wasi_http_no_trap_on_early_drop() -> Result<()> {
.method(http::Method::GET);
let resp = run_wasi_http(
- test_programs_artifacts::API_PROXY_COMPONENT,
+ test_programs_artifacts::P2_API_PROXY_COMPONENT,
req.body(body::empty())?,
None,
None,
diff --git a/crates/wasi-http/tests/all/p2/async_.rs b/crates/wasi-http/tests/all/p2/async_.rs
index d3dc1793eb..8d94a011df 100644
--- a/crates/wasi-http/tests/all/p2/async_.rs
+++ b/crates/wasi-http/tests/all/p2/async_.rs
@@ -2,7 +2,7 @@ use super::*;
use test_programs_artifacts::*;
use wasmtime_wasi::p2::bindings::Command;
-foreach_http!(assert_test_exists);
+foreach_p2_http!(assert_test_exists);
async fn run(path: &str, server: &Server) -> Result<()> {
let engine = test_programs_artifacts::engine(|config| {
@@ -20,88 +20,92 @@ async fn run(path: &str, server: &Server) -> Result<()> {
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_get() -> Result<()> {
+async fn p2_http_outbound_request_get() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_GET_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_GET_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_timeout() -> Result<()> {
+async fn p2_http_outbound_request_timeout() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_TIMEOUT_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_TIMEOUT_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_post() -> Result<()> {
+async fn p2_http_outbound_request_post() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_POST_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_POST_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_large_post() -> Result<()> {
+async fn p2_http_outbound_request_large_post() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_LARGE_POST_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_LARGE_POST_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_put() -> Result<()> {
+async fn p2_http_outbound_request_put() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_PUT_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_PUT_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_invalid_version() -> Result<()> {
+async fn p2_http_outbound_request_invalid_version() -> Result<()> {
let server = Server::http2(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_VERSION_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_VERSION_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_invalid_header() -> Result<()> {
+async fn p2_http_outbound_request_invalid_header() -> Result<()> {
let server = Server::http2(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_HEADER_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_HEADER_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_unknown_method() -> Result<()> {
+async fn p2_http_outbound_request_unknown_method() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_UNKNOWN_METHOD_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_UNKNOWN_METHOD_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_unsupported_scheme() -> Result<()> {
+async fn p2_http_outbound_request_unsupported_scheme() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_UNSUPPORTED_SCHEME_COMPONENT, &server).await
+ run(
+ P2_HTTP_OUTBOUND_REQUEST_UNSUPPORTED_SCHEME_COMPONENT,
+ &server,
+ )
+ .await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_invalid_port() -> Result<()> {
+async fn p2_http_outbound_request_invalid_port() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_PORT_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_PORT_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_invalid_dnsname() -> Result<()> {
+async fn p2_http_outbound_request_invalid_dnsname() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_DNSNAME_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_DNSNAME_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_response_build() -> Result<()> {
+async fn p2_http_outbound_request_response_build() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_RESPONSE_BUILD_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_RESPONSE_BUILD_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_content_length() -> Result<()> {
+async fn p2_http_outbound_request_content_length() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_CONTENT_LENGTH_COMPONENT, &server).await
+ run(P2_HTTP_OUTBOUND_REQUEST_CONTENT_LENGTH_COMPONENT, &server).await
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn http_outbound_request_missing_path_and_query() -> Result<()> {
+async fn p2_http_outbound_request_missing_path_and_query() -> Result<()> {
let server = Server::http1(1)?;
run(
- HTTP_OUTBOUND_REQUEST_MISSING_PATH_AND_QUERY_COMPONENT,
+ P2_HTTP_OUTBOUND_REQUEST_MISSING_PATH_AND_QUERY_COMPONENT,
&server,
)
.await
diff --git a/crates/wasi-http/tests/all/p2/sync.rs b/crates/wasi-http/tests/all/p2/sync.rs
index 79b2e5de5d..849cf40564 100644
--- a/crates/wasi-http/tests/all/p2/sync.rs
+++ b/crates/wasi-http/tests/all/p2/sync.rs
@@ -2,7 +2,7 @@ use super::*;
use test_programs_artifacts::*;
use wasmtime_wasi::p2::bindings::sync::Command;
-foreach_http!(assert_test_exists);
+foreach_p2_http!(assert_test_exists);
fn run(path: &str, server: &Server) -> Result<()> {
let engine = test_programs_artifacts::engine(|config| {
@@ -19,88 +19,91 @@ fn run(path: &str, server: &Server) -> Result<()> {
}
#[test_log::test]
-fn http_outbound_request_get() -> Result<()> {
+fn p2_http_outbound_request_get() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_GET_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_GET_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_timeout() -> Result<()> {
+fn p2_http_outbound_request_timeout() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_TIMEOUT_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_TIMEOUT_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_post() -> Result<()> {
+fn p2_http_outbound_request_post() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_POST_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_POST_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_large_post() -> Result<()> {
+fn p2_http_outbound_request_large_post() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_LARGE_POST_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_LARGE_POST_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_put() -> Result<()> {
+fn p2_http_outbound_request_put() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_PUT_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_PUT_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_invalid_version() -> Result<()> {
+fn p2_http_outbound_request_invalid_version() -> Result<()> {
let server = Server::http2(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_VERSION_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_VERSION_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_invalid_header() -> Result<()> {
+fn p2_http_outbound_request_invalid_header() -> Result<()> {
let server = Server::http2(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_HEADER_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_HEADER_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_unknown_method() -> Result<()> {
+fn p2_http_outbound_request_unknown_method() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_UNKNOWN_METHOD_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_UNKNOWN_METHOD_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_unsupported_scheme() -> Result<()> {
+fn p2_http_outbound_request_unsupported_scheme() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_UNSUPPORTED_SCHEME_COMPONENT, &server)
+ run(
+ P2_HTTP_OUTBOUND_REQUEST_UNSUPPORTED_SCHEME_COMPONENT,
+ &server,
+ )
}
#[test_log::test]
-fn http_outbound_request_invalid_port() -> Result<()> {
+fn p2_http_outbound_request_invalid_port() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_PORT_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_PORT_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_invalid_dnsname() -> Result<()> {
+fn p2_http_outbound_request_invalid_dnsname() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_INVALID_DNSNAME_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_INVALID_DNSNAME_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_response_build() -> Result<()> {
+fn p2_http_outbound_request_response_build() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_RESPONSE_BUILD_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_RESPONSE_BUILD_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_content_length() -> Result<()> {
+fn p2_http_outbound_request_content_length() -> Result<()> {
let server = Server::http1(1)?;
- run(HTTP_OUTBOUND_REQUEST_CONTENT_LENGTH_COMPONENT, &server)
+ run(P2_HTTP_OUTBOUND_REQUEST_CONTENT_LENGTH_COMPONENT, &server)
}
#[test_log::test]
-fn http_outbound_request_missing_path_and_query() -> Result<()> {
+fn p2_http_outbound_request_missing_path_and_query() -> Result<()> {
let server = Server::http1(1)?;
run(
- HTTP_OUTBOUND_REQUEST_MISSING_PATH_AND_QUERY_COMPONENT,
+ P2_HTTP_OUTBOUND_REQUEST_MISSING_PATH_AND_QUERY_COMPONENT,
&server,
)
}
diff --git a/crates/wasi/tests/all/p1.rs b/crates/wasi/tests/all/p1.rs
index ee7af15271..3b95112e43 100644
--- a/crates/wasi/tests/all/p1.rs
+++ b/crates/wasi/tests/all/p1.rs
@@ -27,227 +27,225 @@ async fn run(path: &str, inherit_stdio: bool) -> Result<()> {
Ok(())
}
-foreach_preview1!(assert_test_exists);
+foreach_p1!(assert_test_exists);
// Below here is mechanical: there should be one test for every binary in
// wasi-tests.
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_big_random_buf() {
- run(PREVIEW1_BIG_RANDOM_BUF, false).await.unwrap()
+async fn p1_big_random_buf() {
+ run(P1_BIG_RANDOM_BUF, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_clock_time_get() {
- run(PREVIEW1_CLOCK_TIME_GET, false).await.unwrap()
+async fn p1_clock_time_get() {
+ run(P1_CLOCK_TIME_GET, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_close_preopen() {
- run(PREVIEW1_CLOSE_PREOPEN, false).await.unwrap()
+async fn p1_close_preopen() {
+ run(P1_CLOSE_PREOPEN, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dangling_fd() {
- run(PREVIEW1_DANGLING_FD, false).await.unwrap()
+async fn p1_dangling_fd() {
+ run(P1_DANGLING_FD, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dangling_symlink() {
- run(PREVIEW1_DANGLING_SYMLINK, false).await.unwrap()
+async fn p1_dangling_symlink() {
+ run(P1_DANGLING_SYMLINK, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_directory_seek() {
- run(PREVIEW1_DIRECTORY_SEEK, false).await.unwrap()
+async fn p1_directory_seek() {
+ run(P1_DIRECTORY_SEEK, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dir_fd_op_failures() {
- run(PREVIEW1_DIR_FD_OP_FAILURES, false).await.unwrap()
+async fn p1_dir_fd_op_failures() {
+ run(P1_DIR_FD_OP_FAILURES, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_advise() {
- run(PREVIEW1_FD_ADVISE, false).await.unwrap()
+async fn p1_fd_advise() {
+ run(P1_FD_ADVISE, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_filestat_get() {
- run(PREVIEW1_FD_FILESTAT_GET, false).await.unwrap()
+async fn p1_fd_filestat_get() {
+ run(P1_FD_FILESTAT_GET, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_filestat_set() {
- run(PREVIEW1_FD_FILESTAT_SET, false).await.unwrap()
+async fn p1_fd_filestat_set() {
+ run(P1_FD_FILESTAT_SET, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_flags_set() {
- run(PREVIEW1_FD_FLAGS_SET, false).await.unwrap()
+async fn p1_fd_flags_set() {
+ run(P1_FD_FLAGS_SET, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_readdir() {
- run(PREVIEW1_FD_READDIR, false).await.unwrap()
+async fn p1_fd_readdir() {
+ run(P1_FD_READDIR, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_allocate() {
- run(PREVIEW1_FILE_ALLOCATE, false).await.unwrap()
+async fn p1_file_allocate() {
+ run(P1_FILE_ALLOCATE, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_pread_pwrite() {
- run(PREVIEW1_FILE_PREAD_PWRITE, false).await.unwrap()
+async fn p1_file_pread_pwrite() {
+ run(P1_FILE_PREAD_PWRITE, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_read_write() {
- run(PREVIEW1_FILE_READ_WRITE, false).await.unwrap()
+async fn p1_file_read_write() {
+ run(P1_FILE_READ_WRITE, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_seek_tell() {
- run(PREVIEW1_FILE_SEEK_TELL, false).await.unwrap()
+async fn p1_file_seek_tell() {
+ run(P1_FILE_SEEK_TELL, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_truncation() {
- run(PREVIEW1_FILE_TRUNCATION, false).await.unwrap()
+async fn p1_file_truncation() {
+ run(P1_FILE_TRUNCATION, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_unbuffered_write() {
- run(PREVIEW1_FILE_UNBUFFERED_WRITE, false).await.unwrap()
+async fn p1_file_unbuffered_write() {
+ run(P1_FILE_UNBUFFERED_WRITE, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_interesting_paths() {
- run(PREVIEW1_INTERESTING_PATHS, true).await.unwrap()
+async fn p1_interesting_paths() {
+ run(P1_INTERESTING_PATHS, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_regular_file_isatty() {
- run(PREVIEW1_REGULAR_FILE_ISATTY, false).await.unwrap()
+async fn p1_regular_file_isatty() {
+ run(P1_REGULAR_FILE_ISATTY, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_nofollow_errors() {
- run(PREVIEW1_NOFOLLOW_ERRORS, false).await.unwrap()
+async fn p1_nofollow_errors() {
+ run(P1_NOFOLLOW_ERRORS, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_overwrite_preopen() {
- run(PREVIEW1_OVERWRITE_PREOPEN, false).await.unwrap()
+async fn p1_overwrite_preopen() {
+ run(P1_OVERWRITE_PREOPEN, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_exists() {
- run(PREVIEW1_PATH_EXISTS, false).await.unwrap()
+async fn p1_path_exists() {
+ run(P1_PATH_EXISTS, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_filestat() {
- run(PREVIEW1_PATH_FILESTAT, false).await.unwrap()
+async fn p1_path_filestat() {
+ run(P1_PATH_FILESTAT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_link() {
- run(PREVIEW1_PATH_LINK, false).await.unwrap()
+async fn p1_path_link() {
+ run(P1_PATH_LINK, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_create_existing() {
- run(PREVIEW1_PATH_OPEN_CREATE_EXISTING, false)
- .await
- .unwrap()
+async fn p1_path_open_create_existing() {
+ run(P1_PATH_OPEN_CREATE_EXISTING, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_read_write() {
- run(PREVIEW1_PATH_OPEN_READ_WRITE, false).await.unwrap()
+async fn p1_path_open_read_write() {
+ run(P1_PATH_OPEN_READ_WRITE, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_dirfd_not_dir() {
- run(PREVIEW1_PATH_OPEN_DIRFD_NOT_DIR, false).await.unwrap()
+async fn p1_path_open_dirfd_not_dir() {
+ run(P1_PATH_OPEN_DIRFD_NOT_DIR, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_missing() {
- run(PREVIEW1_PATH_OPEN_MISSING, false).await.unwrap()
+async fn p1_path_open_missing() {
+ run(P1_PATH_OPEN_MISSING, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_nonblock() {
- run(PREVIEW1_PATH_OPEN_NONBLOCK, false).await.unwrap()
+async fn p1_path_open_nonblock() {
+ run(P1_PATH_OPEN_NONBLOCK, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_rename_dir_trailing_slashes() {
- run(PREVIEW1_PATH_RENAME_DIR_TRAILING_SLASHES, false)
+async fn p1_path_rename_dir_trailing_slashes() {
+ run(P1_PATH_RENAME_DIR_TRAILING_SLASHES, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_rename() {
- run(PREVIEW1_PATH_RENAME, false).await.unwrap()
+async fn p1_path_rename() {
+ run(P1_PATH_RENAME, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_symlink_trailing_slashes() {
- run(PREVIEW1_PATH_SYMLINK_TRAILING_SLASHES, false)
- .await
- .unwrap()
+async fn p1_path_symlink_trailing_slashes() {
+ run(P1_PATH_SYMLINK_TRAILING_SLASHES, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_poll_oneoff_files() {
- run(PREVIEW1_POLL_ONEOFF_FILES, false).await.unwrap()
+async fn p1_poll_oneoff_files() {
+ run(P1_POLL_ONEOFF_FILES, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_poll_oneoff_stdio() {
- run(PREVIEW1_POLL_ONEOFF_STDIO, true).await.unwrap()
+async fn p1_poll_oneoff_stdio() {
+ run(P1_POLL_ONEOFF_STDIO, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_readlink() {
- run(PREVIEW1_READLINK, false).await.unwrap()
+async fn p1_readlink() {
+ run(P1_READLINK, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_remove_directory() {
- run(PREVIEW1_REMOVE_DIRECTORY, false).await.unwrap()
+async fn p1_remove_directory() {
+ run(P1_REMOVE_DIRECTORY, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_remove_nonempty_directory() {
- run(PREVIEW1_REMOVE_NONEMPTY_DIRECTORY, false)
- .await
- .unwrap()
+async fn p1_remove_nonempty_directory() {
+ run(P1_REMOVE_NONEMPTY_DIRECTORY, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_renumber() {
- run(PREVIEW1_RENUMBER, false).await.unwrap()
+async fn p1_renumber() {
+ run(P1_RENUMBER, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_sched_yield() {
- run(PREVIEW1_SCHED_YIELD, false).await.unwrap()
+async fn p1_sched_yield() {
+ run(P1_SCHED_YIELD, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio() {
- run(PREVIEW1_STDIO, false).await.unwrap()
+async fn p1_stdio() {
+ run(P1_STDIO, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio_isatty() {
+async fn p1_stdio_isatty() {
// If the test process is setup such that stdio is a terminal:
if test_programs_artifacts::stdio_is_terminal() {
// Inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_ISATTY, true).await.unwrap()
+ run(P1_STDIO_ISATTY, true).await.unwrap()
}
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio_not_isatty() {
+async fn p1_stdio_not_isatty() {
// Don't inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_NOT_ISATTY, false).await.unwrap()
+ run(P1_STDIO_NOT_ISATTY, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_create() {
- run(PREVIEW1_SYMLINK_CREATE, false).await.unwrap()
+async fn p1_symlink_create() {
+ run(P1_SYMLINK_CREATE, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_filestat() {
- run(PREVIEW1_SYMLINK_FILESTAT, false).await.unwrap()
+async fn p1_symlink_filestat() {
+ run(P1_SYMLINK_FILESTAT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_loop() {
- run(PREVIEW1_SYMLINK_LOOP, false).await.unwrap()
+async fn p1_symlink_loop() {
+ run(P1_SYMLINK_LOOP, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_unlink_file_trailing_slashes() {
- run(PREVIEW1_UNLINK_FILE_TRAILING_SLASHES, false)
- .await
- .unwrap()
+async fn p1_unlink_file_trailing_slashes() {
+ run(P1_UNLINK_FILE_TRAILING_SLASHES, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_preopen() {
- run(PREVIEW1_PATH_OPEN_PREOPEN, false).await.unwrap()
+async fn p1_path_open_preopen() {
+ run(P1_PATH_OPEN_PREOPEN, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_unicode_output() {
- run(PREVIEW1_UNICODE_OUTPUT, true).await.unwrap()
+async fn p1_unicode_output() {
+ run(P1_UNICODE_OUTPUT, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_write() {
- run(PREVIEW1_FILE_WRITE, true).await.unwrap()
+async fn p1_file_write() {
+ run(P1_FILE_WRITE, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_lots() {
- run(PREVIEW1_PATH_OPEN_LOTS, true).await.unwrap()
+async fn p1_path_open_lots() {
+ run(P1_PATH_OPEN_LOTS, true).await.unwrap()
}
+
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p1_cli_much_stdout() {}
diff --git a/crates/wasi/tests/all/p2/api.rs b/crates/wasi/tests/all/p2/api.rs
index 306b395ef7..659ededcfa 100644
--- a/crates/wasi/tests/all/p2/api.rs
+++ b/crates/wasi/tests/all/p2/api.rs
@@ -27,7 +27,7 @@ impl WasiView for CommandCtx {
use test_programs_artifacts::*;
-foreach_api!(assert_test_exists);
+foreach_p2_api!(assert_test_exists);
async fn instantiate(path: &str, ctx: CommandCtx) -> Result<(Store<CommandCtx>, Command)> {
let engine = test_programs_artifacts::engine(|config| {
@@ -43,7 +43,7 @@ async fn instantiate(path: &str, ctx: CommandCtx) -> Result<(Store<CommandCtx>,
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn api_time() -> Result<()> {
+async fn p2_api_time() -> Result<()> {
struct FakeWallClock;
impl HostWallClock for FakeWallClock {
@@ -79,7 +79,8 @@ async fn api_time() -> Result<()> {
.wall_clock(FakeWallClock)
.build();
- let (mut store, command) = instantiate(API_TIME_COMPONENT, CommandCtx { table, wasi }).await?;
+ let (mut store, command) =
+ instantiate(P2_API_TIME_COMPONENT, CommandCtx { table, wasi }).await?;
command
.wasi_cli_run()
@@ -89,7 +90,7 @@ async fn api_time() -> Result<()> {
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn api_read_only() -> Result<()> {
+async fn p2_api_read_only() -> Result<()> {
let dir = tempfile::tempdir()?;
std::fs::File::create(dir.path().join("bar.txt"))?.write_all(b"And stood awhile in thought")?;
@@ -101,7 +102,7 @@ async fn api_read_only() -> Result<()> {
.build();
let (mut store, command) =
- instantiate(API_READ_ONLY_COMPONENT, CommandCtx { table, wasi }).await?;
+ instantiate(P2_API_READ_ONLY_COMPONENT, CommandCtx { table, wasi }).await?;
command
.wasi_cli_run()
@@ -114,19 +115,19 @@ async fn api_read_only() -> Result<()> {
dead_code,
reason = "tested in the wasi-http crate, satisfying foreach_api! macro"
)]
-fn api_proxy() {}
+fn p2_api_proxy() {}
#[expect(
dead_code,
reason = "tested in the wasi-http crate, satisfying foreach_api! macro"
)]
-fn api_proxy_streaming() {}
+fn p2_api_proxy_streaming() {}
#[expect(
dead_code,
reason = "tested in the wasi-http crate, satisfying foreach_api! macro"
)]
-fn api_proxy_forward_request() {}
+fn p2_api_proxy_forward_request() {}
wasmtime::component::bindgen!({
path: "src/p2/wit",
@@ -141,7 +142,7 @@ wasmtime::component::bindgen!({
});
#[test_log::test(tokio::test)]
-async fn api_reactor() -> Result<()> {
+async fn p2_api_reactor() -> Result<()> {
let table = ResourceTable::new();
let wasi = WasiCtxBuilder::new().env("GOOD_DOG", "gussie").build();
let engine = test_programs_artifacts::engine(|config| {
@@ -151,7 +152,7 @@ async fn api_reactor() -> Result<()> {
add_to_linker_async(&mut linker)?;
let mut store = Store::new(&engine, CommandCtx { table, wasi });
- let component = Component::from_file(&engine, API_REACTOR_COMPONENT)?;
+ let component = Component::from_file(&engine, P2_API_REACTOR_COMPONENT)?;
let reactor = TestReactor::instantiate_async(&mut store, &component, &linker).await?;
// Show that integration with the WASI context is working - the guest will
diff --git a/crates/wasi/tests/all/p2/async_.rs b/crates/wasi/tests/all/p2/async_.rs
index d5ecc4c39e..0d9680b8ce 100644
--- a/crates/wasi/tests/all/p2/async_.rs
+++ b/crates/wasi/tests/all/p2/async_.rs
@@ -33,345 +33,305 @@ async fn run(path: &str, inherit_stdio: bool) -> Result<()> {
.map_err(|()| anyhow::anyhow!("run returned a failure"))
}
-foreach_preview1!(assert_test_exists);
-foreach_preview2!(assert_test_exists);
+foreach_p1!(assert_test_exists);
+foreach_p2!(assert_test_exists);
// Below here is mechanical: there should be one test for every binary in
// wasi-tests.
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_big_random_buf() {
- run(PREVIEW1_BIG_RANDOM_BUF_COMPONENT, false).await.unwrap()
+async fn p1_big_random_buf() {
+ run(P1_BIG_RANDOM_BUF_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_clock_time_get() {
- run(PREVIEW1_CLOCK_TIME_GET_COMPONENT, false).await.unwrap()
+async fn p1_clock_time_get() {
+ run(P1_CLOCK_TIME_GET_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_close_preopen() {
- run(PREVIEW1_CLOSE_PREOPEN_COMPONENT, false).await.unwrap()
+async fn p1_close_preopen() {
+ run(P1_CLOSE_PREOPEN_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dangling_fd() {
- run(PREVIEW1_DANGLING_FD_COMPONENT, false).await.unwrap()
+async fn p1_dangling_fd() {
+ run(P1_DANGLING_FD_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dangling_symlink() {
- run(PREVIEW1_DANGLING_SYMLINK_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_dangling_symlink() {
+ run(P1_DANGLING_SYMLINK_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_directory_seek() {
- run(PREVIEW1_DIRECTORY_SEEK_COMPONENT, false).await.unwrap()
+async fn p1_directory_seek() {
+ run(P1_DIRECTORY_SEEK_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_dir_fd_op_failures() {
- run(PREVIEW1_DIR_FD_OP_FAILURES_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_dir_fd_op_failures() {
+ run(P1_DIR_FD_OP_FAILURES_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_advise() {
- run(PREVIEW1_FD_ADVISE_COMPONENT, false).await.unwrap()
+async fn p1_fd_advise() {
+ run(P1_FD_ADVISE_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_filestat_get() {
- run(PREVIEW1_FD_FILESTAT_GET_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_fd_filestat_get() {
+ run(P1_FD_FILESTAT_GET_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_filestat_set() {
- run(PREVIEW1_FD_FILESTAT_SET_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_fd_filestat_set() {
+ run(P1_FD_FILESTAT_SET_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_flags_set() {
- run(PREVIEW1_FD_FLAGS_SET_COMPONENT, false).await.unwrap()
+async fn p1_fd_flags_set() {
+ run(P1_FD_FLAGS_SET_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_fd_readdir() {
- run(PREVIEW1_FD_READDIR_COMPONENT, false).await.unwrap()
+async fn p1_fd_readdir() {
+ run(P1_FD_READDIR_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_allocate() {
- run(PREVIEW1_FILE_ALLOCATE_COMPONENT, false).await.unwrap()
+async fn p1_file_allocate() {
+ run(P1_FILE_ALLOCATE_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_pread_pwrite() {
- run(PREVIEW1_FILE_PREAD_PWRITE_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_file_pread_pwrite() {
+ run(P1_FILE_PREAD_PWRITE_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_read_write() {
- run(PREVIEW1_FILE_READ_WRITE_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_file_read_write() {
+ run(P1_FILE_READ_WRITE_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_seek_tell() {
- run(PREVIEW1_FILE_SEEK_TELL_COMPONENT, false).await.unwrap()
+async fn p1_file_seek_tell() {
+ run(P1_FILE_SEEK_TELL_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_truncation() {
- run(PREVIEW1_FILE_TRUNCATION_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_file_truncation() {
+ run(P1_FILE_TRUNCATION_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_unbuffered_write() {
- run(PREVIEW1_FILE_UNBUFFERED_WRITE_COMPONENT, false)
+async fn p1_file_unbuffered_write() {
+ run(P1_FILE_UNBUFFERED_WRITE_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_interesting_paths() {
- run(PREVIEW1_INTERESTING_PATHS_COMPONENT, true)
- .await
- .unwrap()
+async fn p1_interesting_paths() {
+ run(P1_INTERESTING_PATHS_COMPONENT, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_regular_file_isatty() {
- run(PREVIEW1_REGULAR_FILE_ISATTY_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_regular_file_isatty() {
+ run(P1_REGULAR_FILE_ISATTY_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_nofollow_errors() {
- run(PREVIEW1_NOFOLLOW_ERRORS_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_nofollow_errors() {
+ run(P1_NOFOLLOW_ERRORS_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_overwrite_preopen() {
- run(PREVIEW1_OVERWRITE_PREOPEN_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_overwrite_preopen() {
+ run(P1_OVERWRITE_PREOPEN_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_exists() {
- run(PREVIEW1_PATH_EXISTS_COMPONENT, false).await.unwrap()
+async fn p1_path_exists() {
+ run(P1_PATH_EXISTS_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_filestat() {
- run(PREVIEW1_PATH_FILESTAT_COMPONENT, false).await.unwrap()
+async fn p1_path_filestat() {
+ run(P1_PATH_FILESTAT_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_link() {
- run(PREVIEW1_PATH_LINK_COMPONENT, false).await.unwrap()
+async fn p1_path_link() {
+ run(P1_PATH_LINK_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_create_existing() {
- run(PREVIEW1_PATH_OPEN_CREATE_EXISTING_COMPONENT, false)
+async fn p1_path_open_create_existing() {
+ run(P1_PATH_OPEN_CREATE_EXISTING_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_read_write() {
- run(PREVIEW1_PATH_OPEN_READ_WRITE_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_path_open_read_write() {
+ run(P1_PATH_OPEN_READ_WRITE_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_dirfd_not_dir() {
- run(PREVIEW1_PATH_OPEN_DIRFD_NOT_DIR_COMPONENT, false)
+async fn p1_path_open_dirfd_not_dir() {
+ run(P1_PATH_OPEN_DIRFD_NOT_DIR_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_missing() {
- run(PREVIEW1_PATH_OPEN_MISSING_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_path_open_missing() {
+ run(P1_PATH_OPEN_MISSING_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_nonblock() {
- run(PREVIEW1_PATH_OPEN_NONBLOCK_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_path_open_nonblock() {
+ run(P1_PATH_OPEN_NONBLOCK_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_rename_dir_trailing_slashes() {
- run(PREVIEW1_PATH_RENAME_DIR_TRAILING_SLASHES_COMPONENT, false)
+async fn p1_path_rename_dir_trailing_slashes() {
+ run(P1_PATH_RENAME_DIR_TRAILING_SLASHES_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_rename() {
- run(PREVIEW1_PATH_RENAME_COMPONENT, false).await.unwrap()
+async fn p1_path_rename() {
+ run(P1_PATH_RENAME_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_symlink_trailing_slashes() {
- run(PREVIEW1_PATH_SYMLINK_TRAILING_SLASHES_COMPONENT, false)
+async fn p1_path_symlink_trailing_slashes() {
+ run(P1_PATH_SYMLINK_TRAILING_SLASHES_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_poll_oneoff_files() {
- run(PREVIEW1_POLL_ONEOFF_FILES_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_poll_oneoff_files() {
+ run(P1_POLL_ONEOFF_FILES_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_poll_oneoff_stdio() {
- run(PREVIEW1_POLL_ONEOFF_STDIO_COMPONENT, true)
- .await
- .unwrap()
+async fn p1_poll_oneoff_stdio() {
+ run(P1_POLL_ONEOFF_STDIO_COMPONENT, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_readlink() {
- run(PREVIEW1_READLINK_COMPONENT, false).await.unwrap()
+async fn p1_readlink() {
+ run(P1_READLINK_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_remove_directory() {
- run(PREVIEW1_REMOVE_DIRECTORY_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_remove_directory() {
+ run(P1_REMOVE_DIRECTORY_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_remove_nonempty_directory() {
- run(PREVIEW1_REMOVE_NONEMPTY_DIRECTORY_COMPONENT, false)
+async fn p1_remove_nonempty_directory() {
+ run(P1_REMOVE_NONEMPTY_DIRECTORY_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_renumber() {
- run(PREVIEW1_RENUMBER_COMPONENT, false).await.unwrap()
+async fn p1_renumber() {
+ run(P1_RENUMBER_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_sched_yield() {
- run(PREVIEW1_SCHED_YIELD_COMPONENT, false).await.unwrap()
+async fn p1_sched_yield() {
+ run(P1_SCHED_YIELD_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio() {
- run(PREVIEW1_STDIO_COMPONENT, false).await.unwrap()
+async fn p1_stdio() {
+ run(P1_STDIO_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio_isatty() {
+async fn p1_stdio_isatty() {
// If the test process is setup such that stdio is a terminal:
if test_programs_artifacts::stdio_is_terminal() {
// Inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_ISATTY_COMPONENT, true).await.unwrap()
+ run(P1_STDIO_ISATTY_COMPONENT, true).await.unwrap()
}
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_stdio_not_isatty() {
+async fn p1_stdio_not_isatty() {
// Don't inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_NOT_ISATTY_COMPONENT, false)
- .await
- .unwrap()
+ run(P1_STDIO_NOT_ISATTY_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_create() {
- run(PREVIEW1_SYMLINK_CREATE_COMPONENT, false).await.unwrap()
+async fn p1_symlink_create() {
+ run(P1_SYMLINK_CREATE_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_filestat() {
- run(PREVIEW1_SYMLINK_FILESTAT_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_symlink_filestat() {
+ run(P1_SYMLINK_FILESTAT_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_symlink_loop() {
- run(PREVIEW1_SYMLINK_LOOP_COMPONENT, false).await.unwrap()
+async fn p1_symlink_loop() {
+ run(P1_SYMLINK_LOOP_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_unlink_file_trailing_slashes() {
- run(PREVIEW1_UNLINK_FILE_TRAILING_SLASHES_COMPONENT, false)
+async fn p1_unlink_file_trailing_slashes() {
+ run(P1_UNLINK_FILE_TRAILING_SLASHES_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_preopen() {
- run(PREVIEW1_PATH_OPEN_PREOPEN_COMPONENT, false)
- .await
- .unwrap()
+async fn p1_path_open_preopen() {
+ run(P1_PATH_OPEN_PREOPEN_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_unicode_output() {
- run(PREVIEW1_UNICODE_OUTPUT_COMPONENT, true).await.unwrap()
+async fn p1_unicode_output() {
+ run(P1_UNICODE_OUTPUT_COMPONENT, true).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_file_write() {
- run(PREVIEW1_FILE_WRITE_COMPONENT, false).await.unwrap()
+async fn p1_file_write() {
+ run(P1_FILE_WRITE_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview1_path_open_lots() {
- run(PREVIEW1_PATH_OPEN_LOTS_COMPONENT, false).await.unwrap()
+async fn p1_path_open_lots() {
+ run(P1_PATH_OPEN_LOTS_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_sleep() {
- run(PREVIEW2_SLEEP_COMPONENT, false).await.unwrap()
+async fn p2_sleep() {
+ run(P2_SLEEP_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_random() {
- run(PREVIEW2_RANDOM_COMPONENT, false).await.unwrap()
+async fn p2_random() {
+ run(P2_RANDOM_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_ip_name_lookup() {
- run(PREVIEW2_IP_NAME_LOOKUP_COMPONENT, false).await.unwrap()
+async fn p2_ip_name_lookup() {
+ run(P2_IP_NAME_LOOKUP_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_tcp_sockopts() {
- run(PREVIEW2_TCP_SOCKOPTS_COMPONENT, false).await.unwrap()
+async fn p2_tcp_sockopts() {
+ run(P2_TCP_SOCKOPTS_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_tcp_sample_application() {
- run(PREVIEW2_TCP_SAMPLE_APPLICATION_COMPONENT, false)
+async fn p2_tcp_sample_application() {
+ run(P2_TCP_SAMPLE_APPLICATION_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_tcp_states() {
- run(PREVIEW2_TCP_STATES_COMPONENT, false).await.unwrap()
+async fn p2_tcp_states() {
+ run(P2_TCP_STATES_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_tcp_streams() {
- run(PREVIEW2_TCP_STREAMS_COMPONENT, false).await.unwrap()
+async fn p2_tcp_streams() {
+ run(P2_TCP_STREAMS_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_tcp_bind() {
- run(PREVIEW2_TCP_BIND_COMPONENT, false).await.unwrap()
+async fn p2_tcp_bind() {
+ run(P2_TCP_BIND_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_tcp_connect() {
- run(PREVIEW2_TCP_CONNECT_COMPONENT, false).await.unwrap()
+async fn p2_tcp_connect() {
+ run(P2_TCP_CONNECT_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_udp_sockopts() {
- run(PREVIEW2_UDP_SOCKOPTS_COMPONENT, false).await.unwrap()
+async fn p2_udp_sockopts() {
+ run(P2_UDP_SOCKOPTS_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_udp_sample_application() {
- run(PREVIEW2_UDP_SAMPLE_APPLICATION_COMPONENT, false)
+async fn p2_udp_sample_application() {
+ run(P2_UDP_SAMPLE_APPLICATION_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_udp_states() {
- run(PREVIEW2_UDP_STATES_COMPONENT, false).await.unwrap()
+async fn p2_udp_states() {
+ run(P2_UDP_STATES_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_udp_bind() {
- run(PREVIEW2_UDP_BIND_COMPONENT, false).await.unwrap()
+async fn p2_udp_bind() {
+ run(P2_UDP_BIND_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_udp_connect() {
- run(PREVIEW2_UDP_CONNECT_COMPONENT, false).await.unwrap()
+async fn p2_udp_connect() {
+ run(P2_UDP_CONNECT_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_stream_pollable_correct() {
- run(PREVIEW2_STREAM_POLLABLE_CORRECT_COMPONENT, false)
+async fn p2_stream_pollable_correct() {
+ run(P2_STREAM_POLLABLE_CORRECT_COMPONENT, false)
.await
.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_stream_pollable_traps() {
- let e = run(PREVIEW2_STREAM_POLLABLE_TRAPS_COMPONENT, false)
+async fn p2_stream_pollable_traps() {
+ let e = run(P2_STREAM_POLLABLE_TRAPS_COMPONENT, false)
.await
.unwrap_err();
assert_eq!(
@@ -380,28 +340,27 @@ async fn preview2_stream_pollable_traps() {
)
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_pollable_correct() {
- run(PREVIEW2_POLLABLE_CORRECT_COMPONENT, false)
- .await
- .unwrap()
+async fn p2_pollable_correct() {
+ run(P2_POLLABLE_CORRECT_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_pollable_traps() {
- let e = run(PREVIEW2_POLLABLE_TRAPS_COMPONENT, false)
- .await
- .unwrap_err();
+async fn p2_pollable_traps() {
+ let e = run(P2_POLLABLE_TRAPS_COMPONENT, false).await.unwrap_err();
assert_eq!(
format!("{}", e.source().expect("trap source")),
"empty poll list"
)
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_adapter_badfd() {
- run(PREVIEW2_ADAPTER_BADFD_COMPONENT, false).await.unwrap()
+async fn p2_adapter_badfd() {
+ run(P2_ADAPTER_BADFD_COMPONENT, false).await.unwrap()
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
-async fn preview2_file_read_write() {
- run(PREVIEW2_FILE_READ_WRITE_COMPONENT, false)
- .await
- .unwrap()
+async fn p2_file_read_write() {
+ run(P2_FILE_READ_WRITE_COMPONENT, false).await.unwrap()
}
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p1_cli_much_stdout() {}
diff --git a/crates/wasi/tests/all/p2/sync.rs b/crates/wasi/tests/all/p2/sync.rs
index ecce347672..c7f0986ba7 100644
--- a/crates/wasi/tests/all/p2/sync.rs
+++ b/crates/wasi/tests/all/p2/sync.rs
@@ -35,307 +35,312 @@ fn run(path: &str, inherit_stdio: bool) -> Result<()> {
Ok(())
}
-foreach_preview1!(assert_test_exists);
-foreach_preview2!(assert_test_exists);
+foreach_p1!(assert_test_exists);
+foreach_p2!(assert_test_exists);
// Below here is mechanical: there should be one test for every binary in
// wasi-tests.
#[test_log::test]
-fn preview1_big_random_buf() {
- run(PREVIEW1_BIG_RANDOM_BUF_COMPONENT, false).unwrap()
+fn p1_big_random_buf() {
+ run(P1_BIG_RANDOM_BUF_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_clock_time_get() {
- run(PREVIEW1_CLOCK_TIME_GET_COMPONENT, false).unwrap()
+fn p1_clock_time_get() {
+ run(P1_CLOCK_TIME_GET_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_close_preopen() {
- run(PREVIEW1_CLOSE_PREOPEN_COMPONENT, false).unwrap()
+fn p1_close_preopen() {
+ run(P1_CLOSE_PREOPEN_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_dangling_fd() {
- run(PREVIEW1_DANGLING_FD_COMPONENT, false).unwrap()
+fn p1_dangling_fd() {
+ run(P1_DANGLING_FD_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_dangling_symlink() {
- run(PREVIEW1_DANGLING_SYMLINK_COMPONENT, false).unwrap()
+fn p1_dangling_symlink() {
+ run(P1_DANGLING_SYMLINK_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_directory_seek() {
- run(PREVIEW1_DIRECTORY_SEEK_COMPONENT, false).unwrap()
+fn p1_directory_seek() {
+ run(P1_DIRECTORY_SEEK_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_dir_fd_op_failures() {
- run(PREVIEW1_DIR_FD_OP_FAILURES_COMPONENT, false).unwrap()
+fn p1_dir_fd_op_failures() {
+ run(P1_DIR_FD_OP_FAILURES_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_fd_advise() {
- run(PREVIEW1_FD_ADVISE_COMPONENT, false).unwrap()
+fn p1_fd_advise() {
+ run(P1_FD_ADVISE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_fd_filestat_get() {
- run(PREVIEW1_FD_FILESTAT_GET_COMPONENT, false).unwrap()
+fn p1_fd_filestat_get() {
+ run(P1_FD_FILESTAT_GET_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_fd_filestat_set() {
- run(PREVIEW1_FD_FILESTAT_SET_COMPONENT, false).unwrap()
+fn p1_fd_filestat_set() {
+ run(P1_FD_FILESTAT_SET_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_fd_flags_set() {
- run(PREVIEW1_FD_FLAGS_SET_COMPONENT, false).unwrap()
+fn p1_fd_flags_set() {
+ run(P1_FD_FLAGS_SET_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_fd_readdir() {
- run(PREVIEW1_FD_READDIR_COMPONENT, false).unwrap()
+fn p1_fd_readdir() {
+ run(P1_FD_READDIR_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_file_allocate() {
- run(PREVIEW1_FILE_ALLOCATE_COMPONENT, false).unwrap()
+fn p1_file_allocate() {
+ run(P1_FILE_ALLOCATE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_file_pread_pwrite() {
- run(PREVIEW1_FILE_PREAD_PWRITE_COMPONENT, false).unwrap()
+fn p1_file_pread_pwrite() {
+ run(P1_FILE_PREAD_PWRITE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_file_read_write() {
- run(PREVIEW1_FILE_READ_WRITE_COMPONENT, false).unwrap()
+fn p1_file_read_write() {
+ run(P1_FILE_READ_WRITE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_file_seek_tell() {
- run(PREVIEW1_FILE_SEEK_TELL_COMPONENT, false).unwrap()
+fn p1_file_seek_tell() {
+ run(P1_FILE_SEEK_TELL_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_file_truncation() {
- run(PREVIEW1_FILE_TRUNCATION_COMPONENT, false).unwrap()
+fn p1_file_truncation() {
+ run(P1_FILE_TRUNCATION_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_file_unbuffered_write() {
- run(PREVIEW1_FILE_UNBUFFERED_WRITE_COMPONENT, false).unwrap()
+fn p1_file_unbuffered_write() {
+ run(P1_FILE_UNBUFFERED_WRITE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_interesting_paths() {
- run(PREVIEW1_INTERESTING_PATHS_COMPONENT, false).unwrap()
+fn p1_interesting_paths() {
+ run(P1_INTERESTING_PATHS_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_regular_file_isatty() {
- run(PREVIEW1_REGULAR_FILE_ISATTY_COMPONENT, false).unwrap()
+fn p1_regular_file_isatty() {
+ run(P1_REGULAR_FILE_ISATTY_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_nofollow_errors() {
- run(PREVIEW1_NOFOLLOW_ERRORS_COMPONENT, false).unwrap()
+fn p1_nofollow_errors() {
+ run(P1_NOFOLLOW_ERRORS_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_overwrite_preopen() {
- run(PREVIEW1_OVERWRITE_PREOPEN_COMPONENT, false).unwrap()
+fn p1_overwrite_preopen() {
+ run(P1_OVERWRITE_PREOPEN_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_exists() {
- run(PREVIEW1_PATH_EXISTS_COMPONENT, false).unwrap()
+fn p1_path_exists() {
+ run(P1_PATH_EXISTS_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_filestat() {
- run(PREVIEW1_PATH_FILESTAT_COMPONENT, false).unwrap()
+fn p1_path_filestat() {
+ run(P1_PATH_FILESTAT_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_link() {
- run(PREVIEW1_PATH_LINK_COMPONENT, false).unwrap()
+fn p1_path_link() {
+ run(P1_PATH_LINK_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_open_create_existing() {
- run(PREVIEW1_PATH_OPEN_CREATE_EXISTING_COMPONENT, false).unwrap()
+fn p1_path_open_create_existing() {
+ run(P1_PATH_OPEN_CREATE_EXISTING_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_open_read_write() {
- run(PREVIEW1_PATH_OPEN_READ_WRITE_COMPONENT, false).unwrap()
+fn p1_path_open_read_write() {
+ run(P1_PATH_OPEN_READ_WRITE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_open_dirfd_not_dir() {
- run(PREVIEW1_PATH_OPEN_DIRFD_NOT_DIR_COMPONENT, false).unwrap()
+fn p1_path_open_dirfd_not_dir() {
+ run(P1_PATH_OPEN_DIRFD_NOT_DIR_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_open_missing() {
- run(PREVIEW1_PATH_OPEN_MISSING_COMPONENT, false).unwrap()
+fn p1_path_open_missing() {
+ run(P1_PATH_OPEN_MISSING_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_open_nonblock() {
- run(PREVIEW1_PATH_OPEN_NONBLOCK_COMPONENT, false).unwrap()
+fn p1_path_open_nonblock() {
+ run(P1_PATH_OPEN_NONBLOCK_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_rename_dir_trailing_slashes() {
- run(PREVIEW1_PATH_RENAME_DIR_TRAILING_SLASHES_COMPONENT, false).unwrap()
+fn p1_path_rename_dir_trailing_slashes() {
+ run(P1_PATH_RENAME_DIR_TRAILING_SLASHES_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_rename() {
- run(PREVIEW1_PATH_RENAME_COMPONENT, false).unwrap()
+fn p1_path_rename() {
+ run(P1_PATH_RENAME_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_symlink_trailing_slashes() {
- run(PREVIEW1_PATH_SYMLINK_TRAILING_SLASHES_COMPONENT, false).unwrap()
+fn p1_path_symlink_trailing_slashes() {
+ run(P1_PATH_SYMLINK_TRAILING_SLASHES_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_poll_oneoff_files() {
- run(PREVIEW1_POLL_ONEOFF_FILES_COMPONENT, false).unwrap()
+fn p1_poll_oneoff_files() {
+ run(P1_POLL_ONEOFF_FILES_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_poll_oneoff_stdio() {
- run(PREVIEW1_POLL_ONEOFF_STDIO_COMPONENT, true).unwrap()
+fn p1_poll_oneoff_stdio() {
+ run(P1_POLL_ONEOFF_STDIO_COMPONENT, true).unwrap()
}
#[test_log::test]
-fn preview1_readlink() {
- run(PREVIEW1_READLINK_COMPONENT, false).unwrap()
+fn p1_readlink() {
+ run(P1_READLINK_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_remove_directory() {
- run(PREVIEW1_REMOVE_DIRECTORY_COMPONENT, false).unwrap()
+fn p1_remove_directory() {
+ run(P1_REMOVE_DIRECTORY_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_remove_nonempty_directory() {
- run(PREVIEW1_REMOVE_NONEMPTY_DIRECTORY_COMPONENT, false).unwrap()
+fn p1_remove_nonempty_directory() {
+ run(P1_REMOVE_NONEMPTY_DIRECTORY_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_renumber() {
- run(PREVIEW1_RENUMBER_COMPONENT, false).unwrap()
+fn p1_renumber() {
+ run(P1_RENUMBER_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_sched_yield() {
- run(PREVIEW1_SCHED_YIELD_COMPONENT, false).unwrap()
+fn p1_sched_yield() {
+ run(P1_SCHED_YIELD_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_stdio() {
- run(PREVIEW1_STDIO_COMPONENT, false).unwrap()
+fn p1_stdio() {
+ run(P1_STDIO_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_stdio_isatty() {
+fn p1_stdio_isatty() {
// If the test process is setup such that stdio is a terminal:
if test_programs_artifacts::stdio_is_terminal() {
// Inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_ISATTY_COMPONENT, true).unwrap()
+ run(P1_STDIO_ISATTY_COMPONENT, true).unwrap()
}
}
#[test_log::test]
-fn preview1_stdio_not_isatty() {
+fn p1_stdio_not_isatty() {
// Don't inherit stdio, test asserts each is not tty:
- run(PREVIEW1_STDIO_NOT_ISATTY_COMPONENT, false).unwrap()
+ run(P1_STDIO_NOT_ISATTY_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_symlink_create() {
- run(PREVIEW1_SYMLINK_CREATE_COMPONENT, false).unwrap()
+fn p1_symlink_create() {
+ run(P1_SYMLINK_CREATE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_symlink_filestat() {
- run(PREVIEW1_SYMLINK_FILESTAT_COMPONENT, false).unwrap()
+fn p1_symlink_filestat() {
+ run(P1_SYMLINK_FILESTAT_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_symlink_loop() {
- run(PREVIEW1_SYMLINK_LOOP_COMPONENT, false).unwrap()
+fn p1_symlink_loop() {
+ run(P1_SYMLINK_LOOP_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_unlink_file_trailing_slashes() {
- run(PREVIEW1_UNLINK_FILE_TRAILING_SLASHES_COMPONENT, false).unwrap()
+fn p1_unlink_file_trailing_slashes() {
+ run(P1_UNLINK_FILE_TRAILING_SLASHES_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_open_preopen() {
- run(PREVIEW1_PATH_OPEN_PREOPEN_COMPONENT, false).unwrap()
+fn p1_path_open_preopen() {
+ run(P1_PATH_OPEN_PREOPEN_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_unicode_output() {
- run(PREVIEW1_UNICODE_OUTPUT_COMPONENT, true).unwrap()
+fn p1_unicode_output() {
+ run(P1_UNICODE_OUTPUT_COMPONENT, true).unwrap()
}
#[test_log::test]
-fn preview1_file_write() {
- run(PREVIEW1_FILE_WRITE_COMPONENT, false).unwrap()
+fn p1_file_write() {
+ run(P1_FILE_WRITE_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview1_path_open_lots() {
- run(PREVIEW1_PATH_OPEN_LOTS_COMPONENT, false).unwrap()
+fn p1_path_open_lots() {
+ run(P1_PATH_OPEN_LOTS_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_sleep() {
- run(PREVIEW2_SLEEP_COMPONENT, false).unwrap()
+fn p2_sleep() {
+ run(P2_SLEEP_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_random() {
- run(PREVIEW2_RANDOM_COMPONENT, false).unwrap()
+fn p2_random() {
+ run(P2_RANDOM_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_ip_name_lookup() {
- run(PREVIEW2_IP_NAME_LOOKUP_COMPONENT, false).unwrap()
+fn p2_ip_name_lookup() {
+ run(P2_IP_NAME_LOOKUP_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_tcp_sockopts() {
- run(PREVIEW2_TCP_SOCKOPTS_COMPONENT, false).unwrap()
+fn p2_tcp_sockopts() {
+ run(P2_TCP_SOCKOPTS_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_tcp_sample_application() {
- run(PREVIEW2_TCP_SAMPLE_APPLICATION_COMPONENT, false).unwrap()
+fn p2_tcp_sample_application() {
+ run(P2_TCP_SAMPLE_APPLICATION_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_tcp_states() {
- run(PREVIEW2_TCP_STATES_COMPONENT, false).unwrap()
+fn p2_tcp_states() {
+ run(P2_TCP_STATES_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_tcp_streams() {
- run(PREVIEW2_TCP_STREAMS_COMPONENT, false).unwrap()
+fn p2_tcp_streams() {
+ run(P2_TCP_STREAMS_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_tcp_bind() {
- run(PREVIEW2_TCP_BIND_COMPONENT, false).unwrap()
+fn p2_tcp_bind() {
+ run(P2_TCP_BIND_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_tcp_connect() {
- run(PREVIEW2_TCP_CONNECT_COMPONENT, false).unwrap()
+fn p2_tcp_connect() {
+ run(P2_TCP_CONNECT_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_udp_sockopts() {
- run(PREVIEW2_UDP_SOCKOPTS_COMPONENT, false).unwrap()
+fn p2_udp_sockopts() {
+ run(P2_UDP_SOCKOPTS_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_udp_sample_application() {
- run(PREVIEW2_UDP_SAMPLE_APPLICATION_COMPONENT, false).unwrap()
+fn p2_udp_sample_application() {
+ run(P2_UDP_SAMPLE_APPLICATION_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_udp_states() {
- run(PREVIEW2_UDP_STATES_COMPONENT, false).unwrap()
+fn p2_udp_states() {
+ run(P2_UDP_STATES_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_udp_bind() {
- run(PREVIEW2_UDP_BIND_COMPONENT, false).unwrap()
+fn p2_udp_bind() {
+ run(P2_UDP_BIND_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_udp_connect() {
- run(PREVIEW2_UDP_CONNECT_COMPONENT, false).unwrap()
+fn p2_udp_connect() {
+ run(P2_UDP_CONNECT_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_stream_pollable_correct() {
- run(PREVIEW2_STREAM_POLLABLE_CORRECT_COMPONENT, false).unwrap()
+fn p2_stream_pollable_correct() {
+ run(P2_STREAM_POLLABLE_CORRECT_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_stream_pollable_traps() {
- let e = run(PREVIEW2_STREAM_POLLABLE_TRAPS_COMPONENT, false).unwrap_err();
+fn p2_stream_pollable_traps() {
+ let e = run(P2_STREAM_POLLABLE_TRAPS_COMPONENT, false).unwrap_err();
assert_eq!(
format!("{}", e.source().expect("trap source")),
"resource has children"
)
}
#[test_log::test]
-fn preview2_pollable_correct() {
- run(PREVIEW2_POLLABLE_CORRECT_COMPONENT, false).unwrap()
+fn p2_pollable_correct() {
+ run(P2_POLLABLE_CORRECT_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_pollable_traps() {
- let e = run(PREVIEW2_POLLABLE_TRAPS_COMPONENT, false).unwrap_err();
+fn p2_pollable_traps() {
+ let e = run(P2_POLLABLE_TRAPS_COMPONENT, false).unwrap_err();
assert_eq!(
format!("{}", e.source().expect("trap source")),
"empty poll list"
)
}
#[test_log::test]
-fn preview2_adapter_badfd() {
- run(PREVIEW2_ADAPTER_BADFD_COMPONENT, false).unwrap()
+fn p2_adapter_badfd() {
+ run(P2_ADAPTER_BADFD_COMPONENT, false).unwrap()
}
#[test_log::test]
-fn preview2_file_read_write() {
- run(PREVIEW2_FILE_READ_WRITE_COMPONENT, false).unwrap()
+fn p2_file_read_write() {
+ run(P2_FILE_READ_WRITE_COMPONENT, false).unwrap()
}
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p1_cli_much_stdout() {}
diff --git a/crates/wasi/tests/all/p3/mod.rs b/crates/wasi/tests/all/p3/mod.rs
index 95c16be477..df299075cd 100644
--- a/crates/wasi/tests/all/p3/mod.rs
+++ b/crates/wasi/tests/all/p3/mod.rs
@@ -150,3 +150,21 @@ async fn p3_file_write() -> anyhow::Result<()> {
async fn p3_file_write_blocking() -> anyhow::Result<()> {
run_allow_blocking_current_thread(P3_FILE_WRITE_COMPONENT, true).await
}
+
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p3_cli_hello_stdout() {}
+
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p3_cli_much_stdout() {}
+
+#[expect(
+ dead_code,
+ reason = "tested in the wasi-cli crate, satisfying foreach_api! macro"
+)]
+fn p3_cli_serve_hello_world() {}
diff --git a/tests/all/cli_tests.rs b/tests/all/cli_tests.rs
index 2232de824e..f623dedacb 100644
--- a/tests/all/cli_tests.rs
+++ b/tests/all/cli_tests.rs
@@ -1121,20 +1121,20 @@ mod test_programs {
use self::$name as _;
};
}
- foreach_cli!(assert_test_exists);
+ foreach_p2_cli!(assert_test_exists);
#[test]
- fn cli_hello_stdout() -> Result<()> {
- run_wasmtime(&["run", "-Wcomponent-model", CLI_HELLO_STDOUT_COMPONENT])?;
+ fn p2_cli_hello_stdout() -> Result<()> {
+ run_wasmtime(&["run", "-Wcomponent-model", P2_CLI_HELLO_STDOUT_COMPONENT])?;
Ok(())
}
#[test]
- fn cli_args() -> Result<()> {
+ fn p2_cli_args() -> Result<()> {
run_wasmtime(&[
"run",
"-Wcomponent-model",
- CLI_ARGS_COMPONENT,
+ P2_CLI_ARGS_COMPONENT,
"hello",
"this",
"",
@@ -1145,9 +1145,9 @@ mod test_programs {
}
#[test]
- fn cli_stdin_empty() -> Result<()> {
+ fn p2_cli_stdin_empty() -> Result<()> {
let mut child = get_wasmtime_command()?
- .args(&["run", "-Wcomponent-model", CLI_STDIN_EMPTY_COMPONENT])
+ .args(&["run", "-Wcomponent-model", P2_CLI_STDIN_EMPTY_COMPONENT])
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.stdin(Stdio::piped())
@@ -1166,9 +1166,9 @@ mod test_programs {
}
#[test]
- fn cli_stdin() -> Result<()> {
+ fn p2_cli_stdin() -> Result<()> {
let mut child = get_wasmtime_command()?
- .args(&["run", "-Wcomponent-model", CLI_STDIN_COMPONENT])
+ .args(&["run", "-Wcomponent-model", P2_CLI_STDIN_COMPONENT])
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.stdin(Stdio::piped())
@@ -1187,9 +1187,9 @@ mod test_programs {
}
#[test]
- fn cli_splice_stdin() -> Result<()> {
+ fn p2_cli_splice_stdin() -> Result<()> {
let mut child = get_wasmtime_command()?
- .args(&["run", "-Wcomponent-model", CLI_SPLICE_STDIN_COMPONENT])
+ .args(&["run", "-Wcomponent-model", P2_CLI_SPLICE_STDIN_COMPONENT])
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.stdin(Stdio::piped())
@@ -1220,19 +1220,19 @@ mod test_programs {
}
#[test]
- fn cli_env() -> Result<()> {
+ fn p2_cli_env() -> Result<()> {
run_wasmtime(&[
"run",
"-Wcomponent-model",
"--env=frabjous=day",
"--env=callooh=callay",
- CLI_ENV_COMPONENT,
+ P2_CLI_ENV_COMPONENT,
])?;
Ok(())
}
#[test]
- fn cli_file_read() -> Result<()> {
+ fn p2_cli_file_read() -> Result<()> {
let dir = tempfile::tempdir()?;
std::fs::write(dir.path().join("bar.txt"), b"And stood awhile in thought")?;
@@ -1241,13 +1241,13 @@ mod test_programs {
"run",
"-Wcomponent-model",
&format!("--dir={}::/", dir.path().to_str().unwrap()),
- CLI_FILE_READ_COMPONENT,
+ P2_CLI_FILE_READ_COMPONENT,
])?;
Ok(())
}
#[test]
- fn cli_file_append() -> Result<()> {
+ fn p2_cli_file_append() -> Result<()> {
let dir = tempfile::tempdir()?;
std::fs::File::create(dir.path().join("bar.txt"))?
@@ -1257,7 +1257,7 @@ mod test_programs {
"run",
"-Wcomponent-model",
&format!("--dir={}::/", dir.path().to_str().unwrap()),
- CLI_FILE_APPEND_COMPONENT,
+ P2_CLI_FILE_APPEND_COMPONENT,
])?;
let contents = std::fs::read(dir.path().join("bar.txt"))?;
@@ -1272,7 +1272,7 @@ mod test_programs {
}
#[test]
- fn cli_file_dir_sync() -> Result<()> {
+ fn p2_cli_file_dir_sync() -> Result<()> {
let dir = tempfile::tempdir()?;
std::fs::File::create(dir.path().join("bar.txt"))?
@@ -1282,28 +1282,28 @@ mod test_programs {
"run",
"-Wcomponent-model",
&format!("--dir={}::/", dir.path().to_str().unwrap()),
- CLI_FILE_DIR_SYNC_COMPONENT,
+ P2_CLI_FILE_DIR_SYNC_COMPONENT,
])?;
Ok(())
}
#[test]
- fn cli_exit_success() -> Result<()> {
- run_wasmtime(&["run", "-Wcomponent-model", CLI_EXIT_SUCCESS_COMPONENT])?;
+ fn p2_cli_exit_success() -> Result<()> {
+ run_wasmtime(&["run", "-Wcomponent-model", P2_CLI_EXIT_SUCCESS_COMPONENT])?;
Ok(())
}
#[test]
- fn cli_exit_default() -> Result<()> {
- run_wasmtime(&["run", "-Wcomponent-model", CLI_EXIT_DEFAULT_COMPONENT])?;
+ fn p2_cli_exit_default() -> Result<()> {
+ run_wasmtime(&["run", "-Wcomponent-model", P2_CLI_EXIT_DEFAULT_COMPONENT])?;
Ok(())
}
#[test]
- fn cli_exit_failure() -> Result<()> {
+ fn p2_cli_exit_failure() -> Result<()> {
let output = get_wasmtime_command()?
- .args(&["run", "-Wcomponent-model", CLI_EXIT_FAILURE_COMPONENT])
+ .args(&["run", "-Wcomponent-model", P2_CLI_EXIT_FAILURE_COMPONENT])
.output()?;
assert!(!output.status.success());
assert_eq!(output.status.code(), Some(1));
@@ -1311,13 +1311,13 @@ mod test_programs {
}
#[test]
- fn cli_exit_with_code() -> Result<()> {
+ fn p2_cli_exit_with_code() -> Result<()> {
let output = get_wasmtime_command()?
.args(&[
"run",
"-Wcomponent-model",
"-Scli-exit-with-code",
- CLI_EXIT_WITH_CODE_COMPONENT,
+ P2_CLI_EXIT_WITH_CODE_COMPONENT,
])
.output()?;
assert!(!output.status.success());
@@ -1326,9 +1326,9 @@ mod test_programs {
}
#[test]
- fn cli_exit_panic() -> Result<()> {
+ fn p2_cli_exit_panic() -> Result<()> {
let output = get_wasmtime_command()?
- .args(&["run", "-Wcomponent-model", CLI_EXIT_PANIC_COMPONENT])
+ .args(&["run", "-Wcomponent-model", P2_CLI_EXIT_PANIC_COMPONENT])
.output()?;
assert!(!output.status.success());
let stderr = String::from_utf8_lossy(&output.stderr);
@@ -1337,7 +1337,7 @@ mod test_programs {
}
#[test]
- fn cli_directory_list() -> Result<()> {
+ fn p2_cli_directory_list() -> Result<()> {
let dir = tempfile::tempdir()?;
std::fs::File::create(dir.path().join("foo.txt"))?;
@@ -1351,23 +1351,23 @@ mod test_programs {
"run",
"-Wcomponent-model",
&format!("--dir={}::/", dir.path().to_str().unwrap()),
- CLI_DIRECTORY_LIST_COMPONENT,
+ P2_CLI_DIRECTORY_LIST_COMPONENT,
])?;
Ok(())
}
#[test]
- fn cli_default_clocks() -> Result<()> {
- run_wasmtime(&["run", "-Wcomponent-model", CLI_DEFAULT_CLOCKS_COMPONENT])?;
+ fn p2_cli_default_clocks() -> Result<()> {
+ run_wasmtime(&["run", "-Wcomponent-model", P2_CLI_DEFAULT_CLOCKS_COMPONENT])?;
Ok(())
}
#[test]
- fn cli_export_cabi_realloc() -> Result<()> {
+ fn p2_cli_export_cabi_realloc() -> Result<()> {
run_wasmtime(&[
"run",
"-Wcomponent-model",
- CLI_EXPORT_CABI_REALLOC_COMPONENT,
+ P2_CLI_EXPORT_CABI_REALLOC_COMPONENT,
])?;
Ok(())
}
@@ -1379,7 +1379,7 @@ mod test_programs {
"-Ccache=no",
"-Wcomponent-model",
"-Scli,http,preview2",
- HTTP_OUTBOUND_REQUEST_RESPONSE_BUILD_COMPONENT,
+ P2_HTTP_OUTBOUND_REQUEST_RESPONSE_BUILD_COMPONENT,
],
None,
)?;
@@ -1397,7 +1397,7 @@ mod test_programs {
// wait for input on stdin, and the test here is to ensure that the
// character shows up here even as the guest is waiting on input via stdin.
#[test]
- fn cli_stdio_write_flushes() -> Result<()> {
+ fn p2_cli_stdio_write_flushes() -> Result<()> {
fn run(args: &[&str]) -> Result<()> {
println!("running {args:?}");
let mut child = get_wasmtime_command()?
@@ -1418,24 +1418,24 @@ mod test_programs {
Ok(())
}
- run(&["run", "-Spreview2=n", CLI_STDIO_WRITE_FLUSHES])?;
- run(&["run", "-Spreview2=y", CLI_STDIO_WRITE_FLUSHES])?;
+ run(&["run", "-Spreview2=n", P2_CLI_STDIO_WRITE_FLUSHES])?;
+ run(&["run", "-Spreview2=y", P2_CLI_STDIO_WRITE_FLUSHES])?;
run(&[
"run",
"-Wcomponent-model",
- CLI_STDIO_WRITE_FLUSHES_COMPONENT,
+ P2_CLI_STDIO_WRITE_FLUSHES_COMPONENT,
])?;
Ok(())
}
#[test]
- fn cli_no_tcp() -> Result<()> {
+ fn p2_cli_no_tcp() -> Result<()> {
let output = super::run_wasmtime_for_output(
&[
"-Wcomponent-model",
// Turn on network but turn off TCP
"-Sinherit-network,tcp=no",
- CLI_NO_TCP_COMPONENT,
+ P2_CLI_NO_TCP_COMPONENT,
],
None,
)?;
@@ -1445,13 +1445,13 @@ mod test_programs {
}
#[test]
- fn cli_no_udp() -> Result<()> {
+ fn p2_cli_no_udp() -> Result<()> {
let output = super::run_wasmtime_for_output(
&[
"-Wcomponent-model",
// Turn on network but turn off UDP
"-Sinherit-network,udp=no",
- CLI_NO_UDP_COMPONENT,
+ P2_CLI_NO_UDP_COMPONENT,
],
None,
)?;
@@ -1461,13 +1461,13 @@ mod test_programs {
}
#[test]
- fn cli_no_ip_name_lookup() -> Result<()> {
+ fn p2_cli_no_ip_name_lookup() -> Result<()> {
let output = super::run_wasmtime_for_output(
&[
"-Wcomponent-model",
// Turn on network but ensure name lookup is disabled
"-Sinherit-network,allow-ip-name-lookup=no",
- CLI_NO_IP_NAME_LOOKUP_COMPONENT,
+ P2_CLI_NO_IP_NAME_LOOKUP_COMPONENT,
],
None,
)?;
@@ -1477,26 +1477,26 @@ mod test_programs {
}
#[test]
- fn cli_sleep() -> Result<()> {
- run_wasmtime(&["run", CLI_SLEEP])?;
- run_wasmtime(&["run", CLI_SLEEP_COMPONENT])?;
+ fn p2_cli_sleep() -> Result<()> {
+ run_wasmtime(&["run", P2_CLI_SLEEP])?;
+ run_wasmtime(&["run", P2_CLI_SLEEP_COMPONENT])?;
Ok(())
}
#[test]
- fn cli_sleep_forever() -> Result<()> {
+ fn p2_cli_sleep_forever() -> Result<()> {
for timeout in [
// Tests still pass when we race with going to sleep.
"-Wtimeout=1ns",
// Tests pass when we wait till the Wasm has (likely) gone to sleep.
"-Wtimeout=250ms",
] {
- let e = run_wasmtime(&["run", timeout, CLI_SLEEP_FOREVER]).unwrap_err();
+ let e = run_wasmtime(&["run", timeout, P2_CLI_SLEEP_FOREVER]).unwrap_err();
let e = e.to_string();
println!("Got error: {e}");
assert!(e.contains("interrupt"));
- let e = run_wasmtime(&["run", timeout, CLI_SLEEP_FOREVER_COMPONENT]).unwrap_err();
+ let e = run_wasmtime(&["run", timeout, P2_CLI_SLEEP_FOREVER_COMPONENT]).unwrap_err();
let e = e.to_string();
println!("Got error: {e}");
assert!(e.contains("interrupt"));
@@ -1693,8 +1693,8 @@ mod test_programs {
}
#[tokio::test]
- async fn cli_serve_echo_env() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_ECHO_ENV_COMPONENT, |cmd| {
+ async fn p2_cli_serve_echo_env() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_ECHO_ENV_COMPONENT, |cmd| {
cmd.arg("--env=FOO=bar");
cmd.arg("--env=BAR");
cmd.arg("-Scli");
@@ -1736,8 +1736,8 @@ mod test_programs {
}
#[tokio::test]
- async fn cli_serve_outgoing_body_config() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_ECHO_ENV_COMPONENT, |cmd| {
+ async fn p2_cli_serve_outgoing_body_config() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_ECHO_ENV_COMPONENT, |cmd| {
cmd.arg("-Scli");
cmd.arg("-Shttp-outgoing-body-buffer-chunks=2");
cmd.arg("-Shttp-outgoing-body-chunk-size=1024");
@@ -1764,8 +1764,8 @@ mod test_programs {
// end of this test race so the stderr may be present or not. Need
// to implement a more graceful shutdown routine for `wasmtime
// serve`.
- async fn cli_serve_respect_pooling_options() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_ECHO_ENV_COMPONENT, |cmd| {
+ async fn p2_cli_serve_respect_pooling_options() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_ECHO_ENV_COMPONENT, |cmd| {
cmd.arg("-Opooling-total-memories=0").arg("-Scli");
})?;
@@ -1788,8 +1788,8 @@ mod test_programs {
}
#[test]
- fn cli_large_env() -> Result<()> {
- for wasm in [CLI_LARGE_ENV, CLI_LARGE_ENV_COMPONENT] {
+ fn p2_cli_large_env() -> Result<()> {
+ for wasm in [P2_CLI_LARGE_ENV, P2_CLI_LARGE_ENV_COMPONENT] {
println!("run {wasm:?}");
let mut cmd = get_wasmtime_command()?;
cmd.arg("run").arg("-Sinherit-env").arg(wasm);
@@ -1812,8 +1812,8 @@ mod test_programs {
}
#[tokio::test]
- async fn cli_serve_only_one_process_allowed() -> Result<()> {
- let wasm = CLI_SERVE_ECHO_ENV_COMPONENT;
+ async fn p2_cli_serve_only_one_process_allowed() -> Result<()> {
+ let wasm = P2_CLI_SERVE_ECHO_ENV_COMPONENT;
let server = WasmtimeServe::new(wasm, |cmd| {
cmd.arg("-Scli");
})?;
@@ -1841,8 +1841,8 @@ mod test_programs {
// in the next process while it technically could be stolen by another
// process.
#[tokio::test]
- async fn cli_serve_quick_rebind_allowed() -> Result<()> {
- let wasm = CLI_SERVE_ECHO_ENV_COMPONENT;
+ async fn p2_cli_serve_quick_rebind_allowed() -> Result<()> {
+ let wasm = P2_CLI_SERVE_ECHO_ENV_COMPONENT;
let server = WasmtimeServe::new(wasm, |cmd| {
cmd.arg("-Scli");
})?;
@@ -1887,8 +1887,8 @@ mod test_programs {
}
#[tokio::test]
- async fn cli_serve_with_print() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_WITH_PRINT_COMPONENT, |cmd| {
+ async fn p2_cli_serve_with_print() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_WITH_PRINT_COMPONENT, |cmd| {
cmd.arg("-Scli");
})?;
@@ -1936,8 +1936,8 @@ stderr [1] :: start a print 1234
}
#[tokio::test]
- async fn cli_serve_with_print_no_prefix() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_WITH_PRINT_COMPONENT, |cmd| {
+ async fn p2_cli_serve_with_print_no_prefix() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_WITH_PRINT_COMPONENT, |cmd| {
cmd.arg("-Scli");
cmd.arg("--no-logging-prefix");
})?;
@@ -1986,8 +1986,8 @@ start a print 1234
}
#[tokio::test]
- async fn cli_serve_authority_and_scheme() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_AUTHORITY_AND_SCHEME_COMPONENT, |cmd| {
+ async fn p2_cli_serve_authority_and_scheme() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_AUTHORITY_AND_SCHEME_COMPONENT, |cmd| {
cmd.arg("-Scli");
})?;
@@ -2017,16 +2017,16 @@ start a print 1234
}
#[test]
- fn cli_argv0() -> Result<()> {
- run_wasmtime(&["run", "--argv0=a", CLI_ARGV0, "a"])?;
- run_wasmtime(&["run", "--argv0=b", CLI_ARGV0_COMPONENT, "b"])?;
- run_wasmtime(&["run", "--argv0=foo.wasm", CLI_ARGV0, "foo.wasm"])?;
+ fn p2_cli_argv0() -> Result<()> {
+ run_wasmtime(&["run", "--argv0=a", P2_CLI_ARGV0, "a"])?;
+ run_wasmtime(&["run", "--argv0=b", P2_CLI_ARGV0_COMPONENT, "b"])?;
+ run_wasmtime(&["run", "--argv0=foo.wasm", P2_CLI_ARGV0, "foo.wasm"])?;
Ok(())
}
#[tokio::test]
- async fn cli_serve_config() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_CONFIG_COMPONENT, |cmd| {
+ async fn p2_cli_serve_config() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_CONFIG_COMPONENT, |cmd| {
cmd.arg("-Scli");
cmd.arg("-Sconfig");
cmd.arg("-Sconfig-var=hello=world");
@@ -2047,7 +2047,7 @@ start a print 1234
}
#[test]
- fn cli_config() -> Result<()> {
+ fn p2_cli_config() -> Result<()> {
run_wasmtime(&[
"run",
"-Sconfig",
@@ -2058,8 +2058,8 @@ start a print 1234
}
#[tokio::test]
- async fn cli_serve_keyvalue() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_KEYVALUE_COMPONENT, |cmd| {
+ async fn p2_cli_serve_keyvalue() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_KEYVALUE_COMPONENT, |cmd| {
cmd.arg("-Scli");
cmd.arg("-Skeyvalue");
cmd.arg("-Skeyvalue-in-memory-data=hello=world");
@@ -2080,7 +2080,7 @@ start a print 1234
}
#[test]
- fn cli_keyvalue() -> Result<()> {
+ fn p2_cli_keyvalue() -> Result<()> {
run_wasmtime(&[
"run",
"-Skeyvalue",
@@ -2091,18 +2091,18 @@ start a print 1234
}
#[test]
- fn cli_multiple_preopens() -> Result<()> {
+ fn p2_cli_multiple_preopens() -> Result<()> {
run_wasmtime(&[
"run",
"--dir=/::/a",
"--dir=/::/b",
"--dir=/::/c",
- CLI_MULTIPLE_PREOPENS_COMPONENT,
+ P2_CLI_MULTIPLE_PREOPENS_COMPONENT,
])?;
Ok(())
}
- async fn cli_serve_guest_never_invoked_set(wasm: &str) -> Result<()> {
+ async fn p2_cli_serve_guest_never_invoked_set(wasm: &str) -> Result<()> {
let server = WasmtimeServe::new(wasm, |cmd| {
cmd.arg("-Scli");
})?;
@@ -2129,22 +2129,22 @@ start a print 1234
}
#[tokio::test]
- async fn cli_serve_return_before_set() -> Result<()> {
- cli_serve_guest_never_invoked_set(CLI_SERVE_RETURN_BEFORE_SET_COMPONENT).await
+ async fn p2_cli_serve_return_before_set() -> Result<()> {
+ p2_cli_serve_guest_never_invoked_set(P2_CLI_SERVE_RETURN_BEFORE_SET_COMPONENT).await
}
#[tokio::test]
- async fn cli_serve_trap_before_set() -> Result<()> {
- cli_serve_guest_never_invoked_set(CLI_SERVE_TRAP_BEFORE_SET_COMPONENT).await
+ async fn p2_cli_serve_trap_before_set() -> Result<()> {
+ p2_cli_serve_guest_never_invoked_set(P2_CLI_SERVE_TRAP_BEFORE_SET_COMPONENT).await
}
#[test]
- fn cli_p3_hello_stdout() -> Result<()> {
+ fn p2_cli_p3_hello_stdout() -> Result<()> {
let output = run_wasmtime(&[
"run",
"-Wcomponent-model-async",
"-Sp3",
- CLI_P3_HELLO_STDOUT_COMPONENT,
+ P3_CLI_HELLO_STDOUT_COMPONENT,
]);
if cfg!(feature = "component-model-async") {
let output = output?;
@@ -2159,14 +2159,14 @@ start a print 1234
use super::*;
#[test]
- fn cli_hello_stdout() -> Result<()> {
- println!("{CLI_HELLO_STDOUT_COMPONENT}");
+ fn p2_cli_hello_stdout() -> Result<()> {
+ println!("{P2_CLI_HELLO_STDOUT_COMPONENT}");
let output = run_wasmtime(&[
"run",
"-Wcomponent-model",
"--invoke",
"run()",
- CLI_HELLO_STDOUT_COMPONENT,
+ P2_CLI_HELLO_STDOUT_COMPONENT,
])?;
// First this component prints "hello, world", then the invoke
// result is printed as "ok".
@@ -2177,13 +2177,13 @@ start a print 1234
#[test]
#[cfg_attr(not(feature = "component-model-async"), ignore)]
- fn cli_invoke_async() -> Result<()> {
+ fn p2_cli_invoke_async() -> Result<()> {
let output = run_wasmtime(&[
"run",
"-Wcomponent-model-async",
"--invoke",
"echo(\"hello?\")",
- CLI_INVOKE_ASYNC_COMPONENT,
+ P2_CLI_INVOKE_ASYNC_COMPONENT,
])?;
assert_eq!(output, "\"hello?\"\n");
Ok(())
@@ -2217,28 +2217,28 @@ start a print 1234
}
#[test]
- fn cli_p1_much_stdout() -> Result<()> {
- run_much_stdout(CLI_P1_MUCH_STDOUT_COMPONENT, &[])
+ fn p1_cli_much_stdout() -> Result<()> {
+ run_much_stdout(P1_CLI_MUCH_STDOUT_COMPONENT, &[])
}
#[test]
- fn cli_p2_much_stdout() -> Result<()> {
- run_much_stdout(CLI_P2_MUCH_STDOUT_COMPONENT, &[])
+ fn p2_cli_much_stdout() -> Result<()> {
+ run_much_stdout(P2_CLI_MUCH_STDOUT_COMPONENT, &[])
}
#[test]
#[cfg_attr(not(feature = "component-model-async"), ignore)]
- fn cli_p3_much_stdout() -> Result<()> {
+ fn p3_cli_much_stdout() -> Result<()> {
run_much_stdout(
- CLI_P3_MUCH_STDOUT_COMPONENT,
+ P3_CLI_MUCH_STDOUT_COMPONENT,
&["-Wcomponent-model-async", "-Sp3"],
)
}
#[tokio::test]
#[cfg_attr(not(feature = "component-model-async"), ignore)]
- async fn cli_serve_p3_hello_world() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_P3_HELLO_WORLD_COMPONENT, |cmd| {
+ async fn p3_cli_serve_hello_world() -> Result<()> {
+ let server = WasmtimeServe::new(P3_CLI_SERVE_HELLO_WORLD_COMPONENT, |cmd| {
cmd.arg("-Wcomponent-model-async");
cmd.arg("-Sp3,cli");
})?;
@@ -2260,8 +2260,8 @@ start a print 1234
}
#[tokio::test]
- async fn cli_serve_sleep() -> Result<()> {
- let server = WasmtimeServe::new(CLI_SERVE_SLEEP_COMPONENT, |cmd| {
+ async fn p2_cli_serve_sleep() -> Result<()> {
+ let server = WasmtimeServe::new(P2_CLI_SERVE_SLEEP_COMPONENT, |cmd| {
cmd.arg("-Scli").arg("-Wtimeout=100us");
})?;