summaryrefslogtreecommitdiffstats
path: root/tests-integration
diff options
context:
space:
mode:
authorLucio Franco <luciofranco14@gmail.com>2020-10-12 13:44:54 -0400
committerGitHub <noreply@github.com>2020-10-12 13:44:54 -0400
commit8880222036f37c6204c8466f25e828447f16dacb (patch)
treefd623afc20f73bbce65746a3d1b1b2731ecf30a5 /tests-integration
parent0893841f31542b2b04c5050a8a4a3c45cf867e55 (diff)
rt: Remove `threaded_scheduler()` and `basic_scheduler()` (#2876)
Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Carl Lerche <me@carllerche.com>
Diffstat (limited to 'tests-integration')
-rw-r--r--tests-integration/tests/macros_main.rs21
-rw-r--r--tests-integration/tests/rt_shell.rs32
2 files changed, 9 insertions, 44 deletions
diff --git a/tests-integration/tests/macros_main.rs b/tests-integration/tests/macros_main.rs
index 42f5be3b..868adb0f 100644
--- a/tests-integration/tests/macros_main.rs
+++ b/tests-integration/tests/macros_main.rs
@@ -1,4 +1,4 @@
-#![cfg(feature = "macros")]
+#![cfg(all(feature = "macros", feature = "rt-core"))]
#[tokio::main]
async fn basic_main() -> usize {
@@ -10,18 +10,15 @@ async fn generic_fun<T: Default>() -> T {
T::default()
}
-#[cfg(feature = "rt-core")]
-mod spawn {
- #[tokio::main]
- async fn spawning() -> usize {
- let join = tokio::spawn(async { 1 });
- join.await.unwrap()
- }
+#[tokio::main]
+async fn spawning() -> usize {
+ let join = tokio::spawn(async { 1 });
+ join.await.unwrap()
+}
- #[test]
- fn main_with_spawn() {
- assert_eq!(1, spawning());
- }
+#[test]
+fn main_with_spawn() {
+ assert_eq!(1, spawning());
}
#[test]
diff --git a/tests-integration/tests/rt_shell.rs b/tests-integration/tests/rt_shell.rs
deleted file mode 100644
index 012f44a7..00000000
--- a/tests-integration/tests/rt_shell.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-#![warn(rust_2018_idioms)]
-#![cfg(feature = "sync")]
-
-use tokio::runtime;
-use tokio::sync::oneshot;
-
-use std::sync::mpsc;
-use std::thread;
-
-#[test]
-fn basic_shell_rt() {
- let (feed_tx, feed_rx) = mpsc::channel::<oneshot::Sender<()>>();
-
- let th = thread::spawn(move || {
- for tx in feed_rx.iter() {
- tx.send(()).unwrap();
- }
- });
-
- for _ in 0..1_000 {
- let rt = runtime::Builder::new().build().unwrap();
-
- let (tx, rx) = oneshot::channel();
-
- feed_tx.send(tx).unwrap();
-
- rt.block_on(rx).unwrap();
- }
-
- drop(feed_tx);
- th.join().unwrap();
-}