From 7af0c6261387e584f78b218737248f223d0292a4 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 7 Feb 2023 16:03:43 +0100 Subject: [PATCH] Disable tests with in cargo test arguments instead of using a patch --- deactivate-improper-tests.patch | 40 --------------------------------- rust-fallible_collections.spec | 11 ++++----- 2 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 deactivate-improper-tests.patch diff --git a/deactivate-improper-tests.patch b/deactivate-improper-tests.patch deleted file mode 100644 index f59e0ed..0000000 --- a/deactivate-improper-tests.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- fallible_collections-0.4.6/src/vec.rs 2023-02-03 19:12:28.802949438 +0100 -+++ fallible_collections-0.4.6/src/vec.rs 2023-02-03 19:12:28.802949438 +0100 -@@ -821,22 +821,22 @@ mod tests { - assert_eq!(v.try_clone().unwrap(), v); - } - -- #[test] -- fn try_clone_oom() { -- let layout = Layout::new::(); -- let v = -- unsafe { Vec::::from_raw_parts(alloc(layout), core::isize::MAX as usize, core::isize::MAX as usize) }; -- assert!(v.try_clone().is_err()); -- } -+ // #[test] -+ // fn try_clone_oom() { -+ // let layout = Layout::new::(); -+ // let v = -+ // unsafe { Vec::::from_raw_parts(alloc(layout), core::isize::MAX as usize, core::isize::MAX as usize) }; -+ // assert!(v.try_clone().is_err()); -+ // } - -- #[test] -- fn tryvec_try_clone_oom() { -- let layout = Layout::new::(); -- let inner = -- unsafe { Vec::::from_raw_parts(alloc(layout), core::isize::MAX as usize, core::isize::MAX as usize) }; -- let tv = TryVec { inner }; -- assert!(tv.try_clone().is_err()); -- } -+ // #[test] -+ // fn tryvec_try_clone_oom() { -+ // let layout = Layout::new::(); -+ // let inner = -+ // unsafe { Vec::::from_raw_parts(alloc(layout), core::isize::MAX as usize, core::isize::MAX as usize) }; -+ // let tv = TryVec { inner }; -+ // assert!(tv.try_clone().is_err()); -+ // } - - // #[test] - // fn try_out_of_mem() { diff --git a/rust-fallible_collections.spec b/rust-fallible_collections.spec index 994db03..a806d8a 100644 --- a/rust-fallible_collections.spec +++ b/rust-fallible_collections.spec @@ -14,15 +14,10 @@ License: MIT OR Apache-2.0 URL: https://crates.io/crates/fallible_collections Source: %{crates_source} -# Deactivate some tests because they are failing --> -# https://github.com/vcombey/fallible_collections/issues/35 -Patch: deactivate-improper-tests.patch BuildRequires: rust-packaging >= 21 %global _description %{expand: -Implement Fallible collections on allocation errors, quite as describe in RFC 2116. -This was used in the turbofish OS hobby project to mitigate -the lack of faillible allocation in rust.} +Crate which adds fallible allocation api to std collections.} %description %{_description} @@ -116,7 +111,9 @@ use the "unstable" feature of the "%{crate}" crate. %if %{with check} %check -%cargo_test +# * skip two tests that rely on UB and crash with recent Rust versions: +# https://github.com/vcombey/fallible_collections/issues/35 +%cargo_test -- -- --skip try_clone_oom --skip tryvec_try_clone_oom %endif %changelog