]> git.proxmox.com Git - debcargo-conf.git/commitdiff
crossbeam-channel - fix tests with no-default-features.
authorPeter Michael Green <plugwash@debian.org>
Sun, 22 May 2022 20:34:08 +0000 (20:34 +0000)
committerPeter Michael Green <plugwash@debian.org>
Sun, 22 May 2022 20:37:23 +0000 (20:37 +0000)
src/crossbeam-channel/debian/changelog
src/crossbeam-channel/debian/patches/fix-tests-no-default-features.patch [new file with mode: 0644]
src/crossbeam-channel/debian/patches/series [new file with mode: 0644]

index 728a7158ef191b9597f1f31af09476c5074c1178..1dfcf5ae3e507456386ad8e0eabff241448f35bc 100644 (file)
@@ -1,3 +1,11 @@
+rust-crossbeam-channel (0.5.4-2) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
+
+  * Team upload.
+  * Package crossbeam-channel 0.5.4 from crates.io using debcargo 2.5.0
+  * Fix tests with no-default-features.
+
+ -- Peter Michael Green <plugwash@debian.org>  Sun, 22 May 2022 19:52:23 +0000
+
 rust-crossbeam-channel (0.5.4-1) unstable; urgency=medium
 
   * Package crossbeam-channel 0.5.4 from crates.io using debcargo 2.5.0
diff --git a/src/crossbeam-channel/debian/patches/fix-tests-no-default-features.patch b/src/crossbeam-channel/debian/patches/fix-tests-no-default-features.patch
new file mode 100644 (file)
index 0000000..4acf734
--- /dev/null
@@ -0,0 +1,326 @@
+--- rust-crossbeam-channel-0.5.4.orig/benches/crossbeam.rs
++++ rust-crossbeam-channel-0.5.4/benches/crossbeam.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ #![feature(test)]
+ extern crate test;
+--- rust-crossbeam-channel-0.5.4.orig/examples/fibonacci.rs
++++ rust-crossbeam-channel-0.5.4/examples/fibonacci.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! An asynchronous fibonacci sequence generator.
+ use std::thread;
+--- rust-crossbeam-channel-0.5.4.orig/examples/matching.rs
++++ rust-crossbeam-channel-0.5.4/examples/matching.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Using `select!` to send and receive on the same channel at the same time.
+ //!
+ //! This example is based on the following program in Go.
+--- rust-crossbeam-channel-0.5.4.orig/examples/stopwatch.rs
++++ rust-crossbeam-channel-0.5.4/examples/stopwatch.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Prints the elapsed time every 1 second and quits on Ctrl+C.
+ #[cfg(windows)] // signal_hook::iterator does not work on windows
+--- rust-crossbeam-channel-0.5.4.orig/tests/after.rs
++++ rust-crossbeam-channel-0.5.4/tests/after.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for the after channel flavor.
+ #![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow
+--- rust-crossbeam-channel-0.5.4.orig/tests/array.rs
++++ rust-crossbeam-channel-0.5.4/tests/array.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for the array channel flavor.
+ use std::any::Any;
+--- rust-crossbeam-channel-0.5.4.orig/tests/golang.rs
++++ rust-crossbeam-channel-0.5.4/tests/golang.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests copied from Go and manually rewritten in Rust.
+ //!
+ //! Source:
+--- rust-crossbeam-channel-0.5.4.orig/tests/iter.rs
++++ rust-crossbeam-channel-0.5.4/tests/iter.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for iteration over receivers.
+ use crossbeam_channel::unbounded;
+--- rust-crossbeam-channel-0.5.4.orig/tests/list.rs
++++ rust-crossbeam-channel-0.5.4/tests/list.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for the list channel flavor.
+ use std::any::Any;
+--- rust-crossbeam-channel-0.5.4.orig/tests/mpsc.rs
++++ rust-crossbeam-channel-0.5.4/tests/mpsc.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests copied from `std::sync::mpsc`.
+ //!
+ //! This is a copy of tests for the `std::sync::mpsc` channels from the standard library, but
+@@ -33,16 +34,19 @@ use std::time::Duration;
+ use crossbeam_channel as cc;
++#[cfg(feature = "std")]
+ pub struct Sender<T> {
+     pub inner: cc::Sender<T>,
+ }
++#[cfg(feature = "std")]
+ impl<T> Sender<T> {
+     pub fn send(&self, t: T) -> Result<(), SendError<T>> {
+         self.inner.send(t).map_err(|cc::SendError(m)| SendError(m))
+     }
+ }
++#[cfg(feature = "std")]
+ impl<T> Clone for Sender<T> {
+     fn clone(&self) -> Sender<T> {
+         Sender {
+@@ -51,10 +55,12 @@ impl<T> Clone for Sender<T> {
+     }
+ }
++#[cfg(feature = "std")]
+ pub struct SyncSender<T> {
+     pub inner: cc::Sender<T>,
+ }
++#[cfg(feature = "std")]
+ impl<T> SyncSender<T> {
+     pub fn send(&self, t: T) -> Result<(), SendError<T>> {
+         self.inner.send(t).map_err(|cc::SendError(m)| SendError(m))
+@@ -68,6 +74,7 @@ impl<T> SyncSender<T> {
+     }
+ }
++#[cfg(feature = "std")]
+ impl<T> Clone for SyncSender<T> {
+     fn clone(&self) -> SyncSender<T> {
+         SyncSender {
+@@ -76,10 +83,12 @@ impl<T> Clone for SyncSender<T> {
+     }
+ }
++#[cfg(feature = "std")]
+ pub struct Receiver<T> {
+     pub inner: cc::Receiver<T>,
+ }
++#[cfg(feature = "std")]
+ impl<T> Receiver<T> {
+     pub fn try_recv(&self) -> Result<T, TryRecvError> {
+         self.inner.try_recv().map_err(|err| match err {
+@@ -108,6 +117,7 @@ impl<T> Receiver<T> {
+     }
+ }
++#[cfg(feature = "std")]
+ impl<'a, T> IntoIterator for &'a Receiver<T> {
+     type Item = T;
+     type IntoIter = Iter<'a, T>;
+@@ -117,6 +127,7 @@ impl<'a, T> IntoIterator for &'a Receive
+     }
+ }
++#[cfg(feature = "std")]
+ impl<T> IntoIterator for Receiver<T> {
+     type Item = T;
+     type IntoIter = IntoIter<T>;
+@@ -126,10 +137,12 @@ impl<T> IntoIterator for Receiver<T> {
+     }
+ }
++#[cfg(feature = "std")]
+ pub struct TryIter<'a, T: 'a> {
+     inner: &'a Receiver<T>,
+ }
++#[cfg(feature = "std")]
+ impl<'a, T> Iterator for TryIter<'a, T> {
+     type Item = T;
+@@ -138,10 +151,12 @@ impl<'a, T> Iterator for TryIter<'a, T>
+     }
+ }
++#[cfg(feature = "std")]
+ pub struct Iter<'a, T: 'a> {
+     inner: &'a Receiver<T>,
+ }
++#[cfg(feature = "std")]
+ impl<'a, T> Iterator for Iter<'a, T> {
+     type Item = T;
+@@ -150,10 +165,12 @@ impl<'a, T> Iterator for Iter<'a, T> {
+     }
+ }
++#[cfg(feature = "std")]
+ pub struct IntoIter<T> {
+     inner: Receiver<T>,
+ }
++#[cfg(feature = "std")]
+ impl<T> Iterator for IntoIter<T> {
+     type Item = T;
+@@ -162,6 +179,7 @@ impl<T> Iterator for IntoIter<T> {
+     }
+ }
++#[cfg(feature = "std")]
+ pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
+     let (s, r) = cc::unbounded();
+     let s = Sender { inner: s };
+@@ -169,6 +187,7 @@ pub fn channel<T>() -> (Sender<T>, Recei
+     (s, r)
+ }
++#[cfg(feature = "std")]
+ pub fn sync_channel<T>(bound: usize) -> (SyncSender<T>, Receiver<T>) {
+     let (s, r) = cc::bounded(bound);
+     let s = SyncSender { inner: s };
+@@ -176,6 +195,7 @@ pub fn sync_channel<T>(bound: usize) ->
+     (s, r)
+ }
++#[cfg(feature = "std")]
+ macro_rules! select {
+     (
+         $($name:pat = $rx:ident.$meth:ident() => $code:expr),+
+@@ -206,6 +226,7 @@ mod channel_tests {
+         }
+     }
++    #[cfg(feature = "std")]
+     #[test]
+     fn smoke() {
+         let (tx, rx) = channel::<i32>();
+@@ -213,12 +234,14 @@ mod channel_tests {
+         assert_eq!(rx.recv().unwrap(), 1);
+     }
++    #[cfg(feature = "std")]
+     #[test]
+     fn drop_full() {
+         let (tx, _rx) = channel::<Box<isize>>();
+         tx.send(Box::new(1)).unwrap();
+     }
++    #[cfg(feature = "std")]
+     #[test]
+     fn drop_full_shared() {
+         let (tx, _rx) = channel::<Box<isize>>();
+@@ -227,6 +250,7 @@ mod channel_tests {
+         tx.send(Box::new(1)).unwrap();
+     }
++    #[cfg(feature = "std")]
+     #[test]
+     fn smoke_shared() {
+         let (tx, rx) = channel::<i32>();
+@@ -237,6 +261,7 @@ mod channel_tests {
+         assert_eq!(rx.recv().unwrap(), 1);
+     }
++    #[cfg(feature = "std")]
+     #[test]
+     fn smoke_threads() {
+         let (tx, rx) = channel::<i32>();
+@@ -247,6 +272,7 @@ mod channel_tests {
+         t.join().unwrap();
+     }
++    #[cfg(feature = "std")]
+     #[test]
+     fn smoke_port_gone() {
+         let (tx, rx) = channel::<i32>();
+@@ -254,6 +280,7 @@ mod channel_tests {
+         assert!(tx.send(1).is_err());
+     }
++    #[cfg(feature = "std")]
+     #[test]
+     fn smoke_shared_port_gone() {
+         let (tx, rx) = channel::<i32>();
+@@ -1707,6 +1734,7 @@ mod sync_channel_tests {
+ }
+ // Source: https://github.com/rust-lang/rust/blob/master/src/libstd/sync/mpsc/select.rs
++#[cfg(feature = "std")]
+ mod select_tests {
+     use super::*;
+--- rust-crossbeam-channel-0.5.4.orig/tests/never.rs
++++ rust-crossbeam-channel-0.5.4/tests/never.rs
+@@ -1,5 +1,5 @@
+ //! Tests for the never channel flavor.
+-
++#![cfg(feature = "std")]
+ use std::thread;
+ use std::time::{Duration, Instant};
+--- rust-crossbeam-channel-0.5.4.orig/tests/ready.rs
++++ rust-crossbeam-channel-0.5.4/tests/ready.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for channel readiness using the `Select` struct.
+ #![allow(clippy::drop_copy)]
+--- rust-crossbeam-channel-0.5.4.orig/tests/same_channel.rs
++++ rust-crossbeam-channel-0.5.4/tests/same_channel.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ use std::time::Duration;
+ use crossbeam_channel::{after, bounded, never, tick, unbounded};
+--- rust-crossbeam-channel-0.5.4.orig/tests/select.rs
++++ rust-crossbeam-channel-0.5.4/tests/select.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for channel selection using the `Select` struct.
+ #![allow(clippy::drop_copy)]
+--- rust-crossbeam-channel-0.5.4.orig/tests/select_macro.rs
++++ rust-crossbeam-channel-0.5.4/tests/select_macro.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for the `select!` macro.
+ #![forbid(unsafe_code)] // select! is safe.
+--- rust-crossbeam-channel-0.5.4.orig/tests/thread_locals.rs
++++ rust-crossbeam-channel-0.5.4/tests/thread_locals.rs
+@@ -1,5 +1,5 @@
+ //! Tests that make sure accessing thread-locals while exiting the thread doesn't cause panics.
+-
++#![cfg(feature = "std")]
+ #![cfg(not(miri))] // error: abnormal termination: the evaluated program aborted execution
+ use std::thread;
+--- rust-crossbeam-channel-0.5.4.orig/tests/tick.rs
++++ rust-crossbeam-channel-0.5.4/tests/tick.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for the tick channel flavor.
+ #![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow
+--- rust-crossbeam-channel-0.5.4.orig/tests/zero.rs
++++ rust-crossbeam-channel-0.5.4/tests/zero.rs
+@@ -1,3 +1,4 @@
++#![cfg(feature = "std")]
+ //! Tests for the zero channel flavor.
+ use std::any::Any;
diff --git a/src/crossbeam-channel/debian/patches/series b/src/crossbeam-channel/debian/patches/series
new file mode 100644 (file)
index 0000000..4122441
--- /dev/null
@@ -0,0 +1 @@
+fix-tests-no-default-features.patch