about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-03-26 01:48:34 +0000
committerbors <bors@rust-lang.org>2019-03-26 01:48:34 +0000
commit54479c624cc24bb852291d83e11cc19389dcb21b (patch)
treeda0a556fb780282ca2f4648e7cb4d57776c92ad0 /src/libstd/thread
parent4c27fb19ba15a2e45485e601a79914c6280196b0 (diff)
parentf229422cc1a0d46d15a7f953f59d8e057ae03865 (diff)
Auto merge of #59136 - jethrogb:jb/sgx-std-test, r=sanxiyn
SGX target: fix std unit tests

This fixes some tests and some code in the SGX sys implementation to make the `std` unit test suite pass.

#59009 must be merged first.
Diffstat (limited to 'src/libstd/thread')
-rw-r--r--src/libstd/thread/local.rs6
-rw-r--r--src/libstd/thread/mod.rs5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 7ad6b124e3a..b73c5856b88 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -530,7 +530,7 @@ mod tests {
 
         thread::spawn(|| {
             assert!(FOO.try_with(|_| ()).is_ok());
-        }).join().ok().unwrap();
+        }).join().ok().expect("thread panicked");
     }
 
     #[test]
@@ -584,7 +584,7 @@ mod tests {
 
         thread::spawn(move|| {
             drop(S1);
-        }).join().ok().unwrap();
+        }).join().ok().expect("thread panicked");
     }
 
     #[test]
@@ -600,7 +600,7 @@ mod tests {
 
         thread::spawn(move|| unsafe {
             K1.with(|s| *s.get() = Some(S1));
-        }).join().ok().unwrap();
+        }).join().ok().expect("thread panicked");
     }
 
     // Note that this test will deadlock if TLS destructors aren't run (this
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index d856f9b465e..6d305aed748 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -1499,7 +1499,7 @@ mod tests {
     fn test_unnamed_thread() {
         thread::spawn(move|| {
             assert!(thread::current().name().is_none());
-        }).join().ok().unwrap();
+        }).join().ok().expect("thread panicked");
     }
 
     #[test]
@@ -1693,6 +1693,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
     fn test_park_timeout_unpark_not_called() {
         for _ in 0..10 {
             thread::park_timeout(Duration::from_millis(10));
@@ -1700,6 +1701,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
     fn test_park_timeout_unpark_called_other_thread() {
         for _ in 0..10 {
             let th = thread::current();
@@ -1714,6 +1716,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
     fn sleep_ms_smoke() {
         thread::sleep(Duration::from_millis(2));
     }