diff --git a/Cargo.toml b/Cargo.toml index 7cc7f6555b..3a690d9fbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,10 @@ exclude = [ "tools", ] +[workspace.dependencies] +bolero = "0.12" +bolero-generator = { version = "0.12", default-features = false } + [profile.release] lto = true codegen-units = 1 diff --git a/common/s2n-codec/Cargo.toml b/common/s2n-codec/Cargo.toml index b4cbcc1b0b..b92a3f2fab 100644 --- a/common/s2n-codec/Cargo.toml +++ b/common/s2n-codec/Cargo.toml @@ -19,14 +19,14 @@ checked_range_unsafe = [] generator = ["bolero-generator"] [dependencies] -bolero-generator = { version = "0.11", default-features = false, optional = true } +bolero-generator = { workspace = true, optional = true } byteorder = { version = "1.1", default-features = false } bytes = { version = "1", default-features = false, optional = true } zerocopy = { version = "0.7", features = ["derive"] } [dev-dependencies] -bolero = "0.11" -bolero-generator = "0.11" +bolero.workspace = true +bolero-generator.workspace = true [package.metadata.kani] flags = { tests = true } diff --git a/common/s2n-codec/src/decoder/checked_range.rs b/common/s2n-codec/src/decoder/checked_range.rs index 1a3f2ffed1..ca7c6bf0d0 100644 --- a/common/s2n-codec/src/decoder/checked_range.rs +++ b/common/s2n-codec/src/decoder/checked_range.rs @@ -12,13 +12,12 @@ pub struct CheckedRange { original_ptr: *const u8, } -#[cfg(any(test, feature = "generator"))] -use bolero_generator::*; - #[cfg(test)] impl bolero::TypeGenerator for CheckedRange { fn generate(driver: &mut D) -> Option { - let start = gen::().generate(driver)?; + use bolero::ValueGenerator; + + let start = bolero::gen::().generate(driver)?; let end = (start..).generate(driver)?; Some(CheckedRange::new(start, end, core::ptr::null())) } diff --git a/common/s2n-codec/src/zerocopy.rs b/common/s2n-codec/src/zerocopy.rs index 3bc28e546c..62edb8c0c2 100644 --- a/common/s2n-codec/src/zerocopy.rs +++ b/common/s2n-codec/src/zerocopy.rs @@ -9,7 +9,7 @@ use core::{ pub use zerocopy::*; #[cfg(feature = "generator")] -use bolero_generator::*; +use bolero_generator::prelude::*; /// Define a codec implementation for a zerocopy value that implements /// `FromBytes`, `AsBytes`, and `Unaligned`. @@ -293,7 +293,7 @@ macro_rules! zerocopy_network_integer { #[cfg(feature = "generator")] impl TypeGenerator for $name { - fn generate(driver: &mut D) -> Option { + fn generate(driver: &mut D) -> Option { Some(Self::new(driver.gen()?)) } } diff --git a/dc/s2n-quic-dc/Cargo.toml b/dc/s2n-quic-dc/Cargo.toml index 39bb4f920d..d05fb7c6e2 100644 --- a/dc/s2n-quic-dc/Cargo.toml +++ b/dc/s2n-quic-dc/Cargo.toml @@ -20,7 +20,7 @@ arrayvec = "0.7" atomic-waker = "1" aws-lc-rs = "1" bitflags = "2" -bolero-generator = { version = "0.11", optional = true } +bolero-generator = { workspace = true, optional = true } bytes = "1" crossbeam-channel = "0.5" crossbeam-epoch = "0.9" @@ -46,8 +46,8 @@ zeroize = "1" parking_lot = "0.12" [dev-dependencies] -bolero = "0.11" -bolero-generator = "0.11" +bolero.workspace = true +bolero-generator.workspace = true insta = "1" s2n-codec = { path = "../../common/s2n-codec", features = ["testing"] } s2n-quic-core = { path = "../../quic/s2n-quic-core", features = ["testing"] } diff --git a/dc/wireshark/Cargo.toml b/dc/wireshark/Cargo.toml index cb0581bbb1..8bc1ae64e8 100644 --- a/dc/wireshark/Cargo.toml +++ b/dc/wireshark/Cargo.toml @@ -14,7 +14,7 @@ s2n-quic-core = { path = "../../quic/s2n-quic-core" } s2n-quic-dc = { path = "../s2n-quic-dc" } [dev-dependencies] -bolero = "0.11" +bolero = "0.12" s2n-quic-core = { path = "../../quic/s2n-quic-core", features = ["testing", "generator"] } s2n-quic-dc = { path = "../s2n-quic-dc", features = ["testing"] } diff --git a/quic/s2n-quic-core/Cargo.toml b/quic/s2n-quic-core/Cargo.toml index 2a771680c2..a0c6b9e800 100644 --- a/quic/s2n-quic-core/Cargo.toml +++ b/quic/s2n-quic-core/Cargo.toml @@ -29,7 +29,7 @@ usdt = ["dep:probe"] [dependencies] atomic-waker = { version = "1", optional = true } -bolero-generator = { version = "0.11", optional = true } +bolero-generator = { workspace = true, optional = true } byteorder = { version = "1", default-features = false } bytes = { version = "1", optional = true, default-features = false } crossbeam-utils = { version = "0.8", optional = true } @@ -49,8 +49,8 @@ futures-test = { version = "0.3", optional = true } # For testing Waker interact once_cell = { version = "1", optional = true } [dev-dependencies] -bolero = "0.11" -bolero-generator = "0.11" +bolero.workspace = true +bolero-generator.workspace = true insta = { version = "1", features = ["json"] } futures = "0.3" futures-test = "0.3" diff --git a/quic/s2n-quic-core/src/connection/id.rs b/quic/s2n-quic-core/src/connection/id.rs index c252b40ba0..0f7179848a 100644 --- a/quic/s2n-quic-core/src/connection/id.rs +++ b/quic/s2n-quic-core/src/connection/id.rs @@ -11,7 +11,7 @@ use core::time::Duration; use s2n_codec::{decoder_value, Encoder, EncoderValue}; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; //= https://www.rfc-editor.org/rfc/rfc9000#section-5.1 //# Each connection possesses a set of connection identifiers, or diff --git a/quic/s2n-quic-core/src/frame/ack.rs b/quic/s2n-quic-core/src/frame/ack.rs index ec93486af7..9ea4f3eab2 100644 --- a/quic/s2n-quic-core/src/frame/ack.rs +++ b/quic/s2n-quic-core/src/frame/ack.rs @@ -443,7 +443,7 @@ const ACK_RANGE_DECODING_ERROR: DecoderError = //# //# ECN counts are maintained separately for each packet number space. #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; #[derive(Copy, Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(any(test, feature = "generator"), derive(TypeGenerator))] diff --git a/quic/s2n-quic-core/src/frame/ack_elicitation.rs b/quic/s2n-quic-core/src/frame/ack_elicitation.rs index 2bce2cea30..ab0572c2e2 100644 --- a/quic/s2n-quic-core/src/frame/ack_elicitation.rs +++ b/quic/s2n-quic-core/src/frame/ack_elicitation.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; use core::ops::{BitOr, BitOrAssign}; //= https://www.rfc-editor.org/rfc/rfc9002#section-2 diff --git a/quic/s2n-quic-core/src/frame/path_validation.rs b/quic/s2n-quic-core/src/frame/path_validation.rs index 1da33d2dcd..32e44357a5 100644 --- a/quic/s2n-quic-core/src/frame/path_validation.rs +++ b/quic/s2n-quic-core/src/frame/path_validation.rs @@ -4,7 +4,7 @@ use core::ops::{BitOr, BitOrAssign}; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; /// Describes if a frame is probing #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] diff --git a/quic/s2n-quic-core/src/inet/ecn.rs b/quic/s2n-quic-core/src/inet/ecn.rs index 29a7db1dde..c57a62b4ac 100644 --- a/quic/s2n-quic-core/src/inet/ecn.rs +++ b/quic/s2n-quic-core/src/inet/ecn.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; //= https://www.rfc-editor.org/rfc/rfc3168#section-5 //# This document specifies that the Internet provide a congestion diff --git a/quic/s2n-quic-core/src/inet/ip.rs b/quic/s2n-quic-core/src/inet/ip.rs index 2be84c7f03..f3c40778b4 100644 --- a/quic/s2n-quic-core/src/inet/ip.rs +++ b/quic/s2n-quic-core/src/inet/ip.rs @@ -9,7 +9,7 @@ use crate::inet::{ use core::fmt; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; /// An IP address, either IPv4 or IPv6. /// diff --git a/quic/s2n-quic-core/src/inet/macros.rs b/quic/s2n-quic-core/src/inet/macros.rs index b54c60fe5e..cda9d83731 100644 --- a/quic/s2n-quic-core/src/inet/macros.rs +++ b/quic/s2n-quic-core/src/inet/macros.rs @@ -10,7 +10,7 @@ macro_rules! define_inet_type { }) => { #[allow(unused_imports)] #[cfg(any(test, feature = "generator"))] - use bolero_generator::*; + use bolero_generator::prelude::*; #[derive(Clone, Copy, Default, Eq, PartialEq, PartialOrd, Ord, zerocopy::FromZeroes, zerocopy::FromBytes, zerocopy::AsBytes, zerocopy::Unaligned)] #[cfg_attr(any(test, feature = "generator"), derive(bolero_generator::TypeGenerator))] diff --git a/quic/s2n-quic-core/src/packet/number/packet_number.rs b/quic/s2n-quic-core/src/packet/number/packet_number.rs index 5fa592a3eb..2e288cf44c 100644 --- a/quic/s2n-quic-core/src/packet/number/packet_number.rs +++ b/quic/s2n-quic-core/src/packet/number/packet_number.rs @@ -18,7 +18,7 @@ use core::{ }; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; const PACKET_SPACE_BITLEN: usize = 2; const PACKET_SPACE_SHIFT: usize = (size_of::() * 8) - PACKET_SPACE_BITLEN; diff --git a/quic/s2n-quic-core/src/packet/number/packet_number_space.rs b/quic/s2n-quic-core/src/packet/number/packet_number_space.rs index 957141fb02..2af5618056 100644 --- a/quic/s2n-quic-core/src/packet/number/packet_number_space.rs +++ b/quic/s2n-quic-core/src/packet/number/packet_number_space.rs @@ -7,7 +7,7 @@ use crate::{ }; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; /// Contains all of the available packet spaces for QUIC packets #[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/quic/s2n-quic-core/src/packet/number/truncated_packet_number.rs b/quic/s2n-quic-core/src/packet/number/truncated_packet_number.rs index 863b15830a..4a2cb5e2f4 100644 --- a/quic/s2n-quic-core/src/packet/number/truncated_packet_number.rs +++ b/quic/s2n-quic-core/src/packet/number/truncated_packet_number.rs @@ -10,7 +10,7 @@ use crate::packet::number::{ use s2n_codec::{u24, DecoderBuffer, DecoderBufferResult, DecoderValue, Encoder, EncoderValue}; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; /// A truncated packet number, which is derived from the largest acknowledged packet number #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/quic/s2n-quic-core/src/path/mod.rs b/quic/s2n-quic-core/src/path/mod.rs index 871a4a0d4f..ead2d7087f 100644 --- a/quic/s2n-quic-core/src/path/mod.rs +++ b/quic/s2n-quic-core/src/path/mod.rs @@ -8,7 +8,7 @@ use crate::{ use core::fmt; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; pub mod ecn; pub mod migration; diff --git a/quic/s2n-quic-core/src/stream/id.rs b/quic/s2n-quic-core/src/stream/id.rs index 79f9054604..8745f9ee7e 100644 --- a/quic/s2n-quic-core/src/stream/id.rs +++ b/quic/s2n-quic-core/src/stream/id.rs @@ -5,7 +5,7 @@ use crate::{endpoint, stream::StreamType, varint::VarInt}; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; /// The ID of a stream. /// diff --git a/quic/s2n-quic-core/src/stream/iter.rs b/quic/s2n-quic-core/src/stream/iter.rs index 9572a85816..78dd4cc7de 100644 --- a/quic/s2n-quic-core/src/stream/iter.rs +++ b/quic/s2n-quic-core/src/stream/iter.rs @@ -3,7 +3,7 @@ use super::StreamId; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; /// An Iterator over Stream Ids of a particular type. #[derive(Debug, Clone, Copy)] diff --git a/quic/s2n-quic-core/src/stream/testing.rs b/quic/s2n-quic-core/src/stream/testing.rs index 77afa7df8c..ca756548c5 100644 --- a/quic/s2n-quic-core/src/stream/testing.rs +++ b/quic/s2n-quic-core/src/stream/testing.rs @@ -7,7 +7,7 @@ use crate::buffer::{reader, writer}; use bytes::Bytes; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; static DATA: Bytes = { const INNER: [u8; DATA_LEN] = { diff --git a/quic/s2n-quic-core/src/transmission/constraint.rs b/quic/s2n-quic-core/src/transmission/constraint.rs index ecf080de54..1e231b9b6f 100644 --- a/quic/s2n-quic-core/src/transmission/constraint.rs +++ b/quic/s2n-quic-core/src/transmission/constraint.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #[cfg(feature = "generator")] -use bolero_generator::*; +use bolero_generator::prelude::*; #[cfg(test)] use bolero::generator::*; diff --git a/quic/s2n-quic-core/src/transmission/mode.rs b/quic/s2n-quic-core/src/transmission/mode.rs index d9493b8740..14c5b59f22 100644 --- a/quic/s2n-quic-core/src/transmission/mode.rs +++ b/quic/s2n-quic-core/src/transmission/mode.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[cfg_attr(any(test, feature = "generator"), derive(TypeGenerator))] diff --git a/quic/s2n-quic-core/src/varint/mod.rs b/quic/s2n-quic-core/src/varint/mod.rs index 8e71ae0513..d99b611f3d 100644 --- a/quic/s2n-quic-core/src/varint/mod.rs +++ b/quic/s2n-quic-core/src/varint/mod.rs @@ -5,7 +5,7 @@ use core::{fmt, ops::Deref}; use s2n_codec::{decoder_value, Encoder, EncoderValue}; #[cfg(any(test, feature = "generator"))] -use bolero_generator::*; +use bolero_generator::prelude::*; use crate::event::IntoEvent; @@ -45,7 +45,7 @@ pub struct VarInt(#[cfg_attr(any(feature = "generator", test), generator(Self::G #[cfg(any(feature = "generator", test))] impl bolero_generator::bounded::BoundedValue for VarInt { - fn gen_bounded( + fn gen_bounded( driver: &mut D, min: core::ops::Bound<&Self>, max: core::ops::Bound<&Self>, diff --git a/quic/s2n-quic-platform/Cargo.toml b/quic/s2n-quic-platform/Cargo.toml index a3f1c6f6d8..d438fe89d8 100644 --- a/quic/s2n-quic-platform/Cargo.toml +++ b/quic/s2n-quic-platform/Cargo.toml @@ -21,7 +21,7 @@ xdp = ["s2n-quic-xdp"] [dependencies] bach = { version = "0.0.6", optional = true } -bolero-generator = { version = "0.11", optional = true } +bolero-generator = { workspace = true, optional = true } cfg-if = "1" futures = { version = "0.3", default-features = false, features = ["async-await"], optional = true } lazy_static = { version = "1", optional = true } @@ -37,8 +37,8 @@ libc = "0.2" [dev-dependencies] bach = { version = "0.0.6" } -bolero = "0.11" -bolero-generator = "0.11" +bolero.workspace = true +bolero-generator.workspace = true futures = { version = "0.3", features = ["std"] } insta = { version = "1", features = ["json"] } s2n-quic-core = { path = "../s2n-quic-core", features = ["testing"] } diff --git a/quic/s2n-quic-platform/src/message/msg.rs b/quic/s2n-quic-platform/src/message/msg.rs index ba19feda10..6e385878c0 100644 --- a/quic/s2n-quic-platform/src/message/msg.rs +++ b/quic/s2n-quic-platform/src/message/msg.rs @@ -28,9 +28,6 @@ pub use ext::Ext; pub use handle::Handle; pub use libc::msghdr as Message; -#[cfg(any(test, feature = "generator"))] -use bolero_generator::*; - impl MessageTrait for msghdr { type Handle = Handle; diff --git a/quic/s2n-quic-platform/src/message/msg/tests.rs b/quic/s2n-quic-platform/src/message/msg/tests.rs index 28c443d18e..b7304e4b7b 100644 --- a/quic/s2n-quic-platform/src/message/msg/tests.rs +++ b/quic/s2n-quic-platform/src/message/msg/tests.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use super::*; -use bolero::check; +use bolero::{check, gen}; use core::mem::zeroed; use s2n_quic_core::inet::{SocketAddress, Unspecified}; diff --git a/quic/s2n-quic-transport/Cargo.toml b/quic/s2n-quic-transport/Cargo.toml index 7a7d60031f..15fd57ce89 100644 --- a/quic/s2n-quic-transport/Cargo.toml +++ b/quic/s2n-quic-transport/Cargo.toml @@ -29,7 +29,7 @@ siphasher = "1.0" smallvec = { version = "1", default-features = false } [dev-dependencies] -bolero = "0.11" +bolero.workspace = true futures-test = "0.3" # For testing Waker interactions insta = { version = "1", features = ["json"] } s2n-codec = { path = "../../common/s2n-codec", features = ["testing"] } diff --git a/quic/s2n-quic/Cargo.toml b/quic/s2n-quic/Cargo.toml index e0e738d7fa..ebde2f30f1 100644 --- a/quic/s2n-quic/Cargo.toml +++ b/quic/s2n-quic/Cargo.toml @@ -84,7 +84,7 @@ zerocopy = { version = "0.7", optional = true, features = ["derive"] } zeroize = { version = "1", optional = true, default-features = false } [dev-dependencies] -bolero = { version = "0.11" } +bolero.workspace = true s2n-quic-core = { path = "../s2n-quic-core", features = ["branch-tracing", "event-tracing", "probe-tracing", "testing"] } s2n-quic-platform = { path = "../s2n-quic-platform", features = ["testing"] } s2n-quic-transport = { path = "../s2n-quic-transport", features = ["unstable_resumption", "unstable-provider-dc"] }