diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-15 12:33:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 12:33:37 -0400 |
| commit | fc1ad2e21c62611932a9fa695213dd67f0cd2767 (patch) | |
| tree | c5bcffb8443affed4a66652a3fc53912731f9a07 /src | |
| parent | 6558e3470b444310af9015db998d216da0fd7b01 (diff) | |
| parent | 1d6643c4f69ba31f91a385c51f46d615bd2b0d66 (diff) | |
| download | rust-fc1ad2e21c62611932a9fa695213dd67f0cd2767.tar.gz rust-fc1ad2e21c62611932a9fa695213dd67f0cd2767.zip | |
Rollup merge of #131705 - hoodmane:fix-emscripten-tests, r=jieyouxu
Fix most ui tests on emscripten target
To fix the linker errors, we need to set the output extension to `.js` instead of `.wasm`. Setting the output to a `.wasm` file puts Emscripten into standalone mode which is effectively a distinct target. We need to set the runner to be `node` as well.
This fixes most of the ui tests. I fixed 4 additional tests with simple problems:
- `intrinsics/intrinsic-alignment.rs` -- Two `#[cfg]` macros match for Emscripten so we got duplicate definition
- `structs-enums/rec-align-u64.rs` -- same problem
- `issues/issue-12699.rs` -- hangs so I disabled it
- `process/process-sigpipe.rs` -- Not expected to work on Emscripten so I disabled it
Resolves #131666.
There are 7 more failing tests. I'll try to investigate more and see if I can fix them or at least understand why they happen.
- abi/numbers-arithmetic/return-float.rs (problem with [wasm treatment of noncanonical floats](https://webassembly.github.io/spec/core/exec/numerics.html#nan-propagation)?)
- async-await/issue-60709.rs -- linker error related to memcpy. Possible Emscripten bug?
- backtrace/dylib-dep.rs -- Says "Not supported"
- backtrace/line-tables-only.rs -- Says "Not supported"
- no_std/no-std-unwind-binary.rs -- compiler says `error: lang item required, but not found: eh_catch_typeinfo`
- structs-enums/enum-rec/issue-17431-6.rs -- One of the two compiler errors is missing
- test-attrs/test-passed.rs
r?workingjubilee r?jieyouxu
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 3 | ||||
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 4 | ||||
| -rw-r--r-- | src/tools/tidy/src/issues.txt | 1 | ||||
| -rw-r--r-- | src/tools/tidy/src/ui_tests.rs | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index f768470c4ff..eb571f920df 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -612,6 +612,9 @@ impl Target { if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") { target.no_std = true; } + if triple.contains("emscripten") { + target.runner = Some("node".into()); + } target } } diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 29f9925de16..69a47fcd0fb 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1643,7 +1643,9 @@ impl<'test> TestCx<'test> { // double the length. let mut f = self.output_base_dir().join("a"); // FIXME: This is using the host architecture exe suffix, not target! - if self.config.target.starts_with("wasm") { + if self.config.target.contains("emscripten") { + f = f.with_extra_extension("js"); + } else if self.config.target.starts_with("wasm") { f = f.with_extra_extension("wasm"); } else if self.config.target.contains("spirv") { f = f.with_extra_extension("spv"); diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 66c176c6f44..22126674c15 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -1520,7 +1520,6 @@ ui/issues/issue-12567.rs ui/issues/issue-12612.rs ui/issues/issue-12660.rs ui/issues/issue-12677.rs -ui/issues/issue-12699.rs ui/issues/issue-12729.rs ui/issues/issue-12744.rs ui/issues/issue-12860.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 41f7778c952..11f9d5bb03d 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -17,7 +17,7 @@ use ignore::Walk; const ENTRY_LIMIT: u32 = 901; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1673; +const ISSUES_ENTRY_LIMIT: u32 = 1672; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files |
