about summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2019-08-16 22:08:01 -0700
committerThomas Lively <tlively@google.com>2019-10-16 17:06:48 -0700
commit2bf59bea481dd4b4365cafe2e94fa8bf330a6877 (patch)
tree1a66e01af701fd21c291788d5eb971f502f5dbee /src/libtest
parent0e8a4b441c5da21a2cb19448728ade5baa299c66 (diff)
downloadrust-2bf59bea481dd4b4365cafe2e94fa8bf330a6877.tar.gz
rust-2bf59bea481dd4b4365cafe2e94fa8bf330a6877.zip
Upgrade Emscripten targets to use upstream LLVM backend
 - Compatible with Emscripten 1.38.46-upstream or later upstream.
 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the old incorrect wasm32 C call ABI with the correct one,
   preserving the old one as wasm32_bindgen_compat for wasm-bindgen
   compatibility.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
Diffstat (limited to 'src/libtest')
-rw-r--r--src/libtest/lib.rs6
-rw-r--r--src/libtest/tests.rs15
2 files changed, 16 insertions, 5 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index 5a77413b2cb..4c3cbeb4acc 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -1735,9 +1735,9 @@ pub fn run_test(
 ) {
     let TestDescAndFn { desc, testfn } = test;
 
-    let ignore_because_no_process_support = cfg!(target_arch = "wasm32")
-        && !cfg!(target_os = "emscripten")
-        && desc.should_panic != ShouldPanic::No;
+    // FIXME: Re-enable emscripten once it can catch panics again
+    let ignore_because_no_process_support = desc.should_panic != ShouldPanic::No
+        && (cfg!(target_arch = "wasm32") || cfg!(target_os = "emscripten"));
 
     if force_ignore || desc.ignore || ignore_because_no_process_support {
         monitor_ch.send((desc, TrIgnored, None, Vec::new())).unwrap();
diff --git a/src/libtest/tests.rs b/src/libtest/tests.rs
index 880d02a28ff..5f7150a8eeb 100644
--- a/src/libtest/tests.rs
+++ b/src/libtest/tests.rs
@@ -2,8 +2,10 @@ use super::*;
 
 use crate::test::{
     filter_tests, parse_opts, run_test, DynTestFn, DynTestName, MetricMap, RunIgnored, RunStrategy,
-    ShouldPanic, StaticTestName, TestDesc, TestDescAndFn, TestOpts, TestTimeOptions,
-    TestType, TrFailedMsg, TrIgnored, TrOk,
+    // ShouldPanic, StaticTestName, TestDesc, TestDescAndFn, TestOpts, TestTimeOptions,
+    // TestType, TrFailedMsg, TrIgnored, TrOk,
+    ShouldPanic, StaticTestName, TestDesc, TestDescAndFn, TestOpts,
+    TrIgnored, TrOk,
 };
 use std::sync::mpsc::channel;
 use std::time::Duration;
@@ -95,7 +97,9 @@ pub fn ignored_tests_result_in_ignored() {
     assert!(res == TrIgnored);
 }
 
+// FIXME: Re-enable emscripten once it can catch panics again
 #[test]
+#[cfg(not(target_os = "emscripten"))]
 fn test_should_panic() {
     fn f() {
         panic!();
@@ -116,7 +120,9 @@ fn test_should_panic() {
     assert!(res == TrOk);
 }
 
+// FIXME: Re-enable emscripten once it can catch panics again
 #[test]
+#[cfg(not(target_os = "emscripten"))]
 fn test_should_panic_good_message() {
     fn f() {
         panic!("an error message");
@@ -137,8 +143,11 @@ fn test_should_panic_good_message() {
     assert!(res == TrOk);
 }
 
+// FIXME: Re-enable emscripten once it can catch panics again
 #[test]
+#[cfg(not(target_os = "emscripten"))]
 fn test_should_panic_bad_message() {
+    use crate::tests::TrFailedMsg;
     fn f() {
         panic!("an error message");
     }
@@ -160,7 +169,9 @@ fn test_should_panic_bad_message() {
     assert!(res == TrFailedMsg(format!("{} '{}'", failed_msg, expected)));
 }
 
+// FIXME: Re-enable emscripten once it can catch panics again
 #[test]
+#[cfg(not(target_os = "emscripten"))]
 fn test_should_panic_but_succeeds() {
     fn f() {}
     let desc = TestDescAndFn {