@@ -32,11 +32,94 @@ jobs:
3232 run : |
3333 curl https://wasmtime.dev/install.sh -sSf | bash
3434 echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
35- - name : Run tests
35+ - name : Run unit tests
3636 env :
3737 CARGO_TARGET_WASM32_WASIP1_RUNNER : wasmtime
3838 run : |
3939 # Get all utilities and exclude ones that don't compile for wasm32-wasip1
4040 EXCLUDE="dd|df|du|env|expr|mktemp|more|tac|test"
4141 UTILS=$(./util/show-utils.sh | tr ' ' '\n' | grep -vE "^($EXCLUDE)$" | sed 's/^/-p uu_/' | tr '\n' ' ')
4242 cargo test --target wasm32-wasip1 --no-default-features $UTILS
43+ - name : Run integration tests via wasmtime
44+ run : |
45+ # Build the WASI binary
46+ cargo build --target wasm32-wasip1 --no-default-features --features feat_wasm
47+ # Run host-compiled integration tests against the WASI binary.
48+ # TODO: add integration tests for these tools as WASI support is extended:
49+ # arch b2sum cat cksum cp csplit date dir dircolors fmt join ln
50+ # ls md5sum mkdir mv nproc pathchk pr printenv ptx pwd readlink
51+ # realpath rm rmdir seq sha1sum sha224sum sha256sum sha384sum
52+ # sha512sum shred sleep sort split tail touch tsort uname uniq
53+ # vdir yes
54+ UUTESTS_BINARY_PATH="$(pwd)/target/wasm32-wasip1/debug/coreutils.wasm" \
55+ UUTESTS_WASM_RUNNER=wasmtime \
56+ cargo test --test tests -- \
57+ test_base32:: test_base64:: test_basenc:: test_basename:: \
58+ test_comm:: test_cut:: test_dirname:: test_echo:: \
59+ test_expand:: test_factor:: test_false:: test_fold:: \
60+ test_head:: test_link:: test_nl:: test_numfmt:: \
61+ test_od:: test_paste:: test_printf:: test_shuf:: test_sum:: \
62+ test_tee:: test_tr:: test_true:: test_truncate:: \
63+ test_unexpand:: test_unlink:: test_wc:: \
64+ \
65+ `# WASI sandbox: host paths (/proc, /sys, /dev) not visible in guest` \
66+ --skip test_factor::test_parallel \
67+ --skip test_cut::test_too_large \
68+ --skip test_read_backwards_bytes_proc_fs_version \
69+ --skip test_read_backwards_bytes_proc_fs_modules \
70+ --skip test_read_backwards_lines_proc_fs_modules \
71+ --skip test_read_backwards_bytes_sys_kernel_profiling \
72+ --skip test_files_from_pseudo_filesystem \
73+ --skip test_files0_stops_after_stdout_write_error \
74+ --skip test_dev_zero_write_error_dev_full \
75+ --skip test_dev_zero_closed_pipe \
76+ --skip test_simd_respects_glibc_tunables \
77+ --skip test_comm::test_comm_anonymous_pipes \
78+ --skip test_comm::test_read_error \
79+ --skip test_base64::test_read_error \
80+ --skip test_expand::test_read_error \
81+ --skip test_unexpand::test_read_error \
82+ --skip test_od::test_skip_bytes_proc_file_without_seeking \
83+ --skip test_shuf::write_errors_are_reported \
84+ --skip test_tee::linux_only \
85+ --skip test_tee::test_readonly \
86+ \
87+ `# WASI spec: argv/filenames must be valid UTF-8` \
88+ --skip test_invalid_utf8_args \
89+ --skip test_dirname_non_utf8_paths \
90+ --skip test_trailing_dot_non_utf8 \
91+ --skip test_8bit_non_utf8_delimiter \
92+ --skip test_non_utf8_delimiter \
93+ --skip test_echo_invalid_unicode_in_arguments \
94+ --skip mb_invalid_unicode \
95+ --skip non_utf_8_input \
96+ --skip non_utf_8 \
97+ --skip test_octal_escape_ambiguous_followed_by_non_utf8 \
98+ --skip test_truncate_non_utf8_set \
99+ --skip test_output_lossy_utf8 \
100+ --skip non_utf8_paths \
101+ --skip non_utf8_filename \
102+ --skip non_utf8_name \
103+ --skip test_invalid_unicode_in_filename \
104+ --skip test_one_byte_section_delimiter \
105+ --skip test_section_delimiter_non_utf8 \
106+ --skip test_number_separator_non_utf8 \
107+ \
108+ `# WASI: no FIFO/mkfifo support` \
109+ --skip test_fifo_error_reference_file_only \
110+ --skip test_fifo_error_reference_and_size \
111+ --skip test_fifo_error_size_only \
112+ \
113+ `# WASI: no pipe/signal support` \
114+ --skip test_broken_pipe_no_error \
115+ --skip test_tee_output_not_buffered \
116+ \
117+ `# WASI: no subprocess spawning (test shells out or invokes another binary)` \
118+ --skip test_all_but_last_bytes_large_file_piped \
119+ --skip test_all_but_last_lines_large_file \
120+ --skip test_cmd_result_stderr_check_and_stderr_str_check \
121+ \
122+ `# WASI: stdin file position not preserved through wasmtime` \
123+ --skip test_od::test_read_bytes \
124+ --skip test_validate_stdin_offset_lines \
125+ --skip test_validate_stdin_offset_bytes
0 commit comments