about summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
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 {