|
7 | 7 | //! reporter. The root structure for all events is [`TestEvent`]. |
8 | 8 |
|
9 | 9 | use super::{FinalStatusLevel, StatusLevel, TestOutputDisplay}; |
| 10 | +#[cfg(test)] |
| 11 | +use crate::output_spec::ArbitraryOutputSpec; |
10 | 12 | use crate::{ |
11 | 13 | config::{ |
12 | 14 | elements::{LeakTimeoutResult, SlowTimeoutResult}, |
13 | 15 | scripts::ScriptId, |
14 | 16 | }, |
15 | 17 | errors::{ChildError, ChildFdError, ChildStartError, ErrorList}, |
16 | 18 | list::{OwnedTestInstanceId, TestInstanceId, TestList}, |
17 | | - output_spec::{LiveSpec, OutputSpec}, |
| 19 | + output_spec::{LiveSpec, OutputSpec, SerializableOutputSpec}, |
18 | 20 | runner::{StressCondition, StressCount}, |
19 | 21 | test_output::{ChildExecutionOutput, ChildOutput, ChildSingleOutput}, |
20 | 22 | }; |
@@ -874,30 +876,27 @@ pub enum RunStatsFailureKind { |
874 | 876 | #[derive(Serialize)] |
875 | 877 | #[serde( |
876 | 878 | rename_all = "kebab-case", |
877 | | - bound(serialize = "S::ChildOutputDesc: Serialize") |
| 879 | + bound(serialize = "S: SerializableOutputSpec") |
878 | 880 | )] |
879 | 881 | #[cfg_attr( |
880 | 882 | test, |
881 | 883 | derive(test_strategy::Arbitrary), |
882 | | - arbitrary(bound(S: 'static, S::ChildOutputDesc: proptest::arbitrary::Arbitrary + std::fmt::Debug + 'static)) |
| 884 | + arbitrary(bound(S: ArbitraryOutputSpec)) |
883 | 885 | )] |
884 | 886 | pub struct ExecutionStatuses<S: OutputSpec> { |
885 | 887 | /// This is guaranteed to be non-empty. |
886 | 888 | #[cfg_attr(test, strategy(proptest::collection::vec(proptest::arbitrary::any::<ExecuteStatus<S>>(), 1..=3)))] |
887 | 889 | statuses: Vec<ExecuteStatus<S>>, |
888 | 890 | } |
889 | 891 |
|
890 | | -impl<'de, S: OutputSpec> Deserialize<'de> for ExecutionStatuses<S> |
891 | | -where |
892 | | - S::ChildOutputDesc: serde::de::DeserializeOwned, |
893 | | -{ |
| 892 | +impl<'de, S: SerializableOutputSpec> Deserialize<'de> for ExecutionStatuses<S> { |
894 | 893 | fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> { |
895 | 894 | // Deserialize as the wrapper struct that matches the Serialize output. |
896 | | - // S is already bound as OutputSpec on this impl. |
| 895 | + // S is already bound as SerializableOutputSpec on this impl. |
897 | 896 | #[derive(Deserialize)] |
898 | 897 | #[serde( |
899 | 898 | rename_all = "kebab-case", |
900 | | - bound(deserialize = "S::ChildOutputDesc: serde::de::DeserializeOwned") |
| 899 | + bound(deserialize = "S: SerializableOutputSpec") |
901 | 900 | )] |
902 | 901 | struct Helper<S: OutputSpec> { |
903 | 902 | statuses: Vec<ExecuteStatus<S>>, |
@@ -1134,14 +1133,14 @@ pub struct OutputErrorSlice { |
1134 | 1133 | #[serde( |
1135 | 1134 | rename_all = "kebab-case", |
1136 | 1135 | bound( |
1137 | | - serialize = "S::ChildOutputDesc: Serialize", |
1138 | | - deserialize = "S::ChildOutputDesc: serde::de::DeserializeOwned" |
| 1136 | + serialize = "S: SerializableOutputSpec", |
| 1137 | + deserialize = "S: SerializableOutputSpec" |
1139 | 1138 | ) |
1140 | 1139 | )] |
1141 | 1140 | #[cfg_attr( |
1142 | 1141 | test, |
1143 | 1142 | derive(test_strategy::Arbitrary), |
1144 | | - arbitrary(bound(S: 'static, S::ChildOutputDesc: proptest::arbitrary::Arbitrary + std::fmt::Debug + 'static)) |
| 1143 | + arbitrary(bound(S: ArbitraryOutputSpec)) |
1145 | 1144 | )] |
1146 | 1145 | pub struct ExecuteStatus<S: OutputSpec> { |
1147 | 1146 | /// Retry-related data. |
@@ -1189,14 +1188,14 @@ pub struct ExecuteStatus<S: OutputSpec> { |
1189 | 1188 | #[serde( |
1190 | 1189 | rename_all = "kebab-case", |
1191 | 1190 | bound( |
1192 | | - serialize = "S::ChildOutputDesc: Serialize", |
1193 | | - deserialize = "S::ChildOutputDesc: serde::de::DeserializeOwned" |
| 1191 | + serialize = "S: SerializableOutputSpec", |
| 1192 | + deserialize = "S: SerializableOutputSpec" |
1194 | 1193 | ) |
1195 | 1194 | )] |
1196 | 1195 | #[cfg_attr( |
1197 | 1196 | test, |
1198 | 1197 | derive(test_strategy::Arbitrary), |
1199 | | - arbitrary(bound(S: 'static, S::ChildOutputDesc: proptest::arbitrary::Arbitrary + std::fmt::Debug + 'static)) |
| 1198 | + arbitrary(bound(S: ArbitraryOutputSpec)) |
1200 | 1199 | )] |
1201 | 1200 | pub struct SetupScriptExecuteStatus<S: OutputSpec> { |
1202 | 1201 | /// Output for this setup script. |
@@ -1257,14 +1256,14 @@ pub struct SetupScriptEnvMap { |
1257 | 1256 | tag = "type", |
1258 | 1257 | rename_all = "kebab-case", |
1259 | 1258 | bound( |
1260 | | - serialize = "S::ChildOutputDesc: Serialize", |
1261 | | - deserialize = "S::ChildOutputDesc: serde::de::DeserializeOwned" |
| 1259 | + serialize = "S: SerializableOutputSpec", |
| 1260 | + deserialize = "S: SerializableOutputSpec" |
1262 | 1261 | ) |
1263 | 1262 | )] |
1264 | 1263 | #[cfg_attr( |
1265 | 1264 | test, |
1266 | 1265 | derive(test_strategy::Arbitrary), |
1267 | | - arbitrary(bound(S: 'static, S::ChildOutputDesc: proptest::arbitrary::Arbitrary + std::fmt::Debug + 'static)) |
| 1266 | + arbitrary(bound(S: ArbitraryOutputSpec)) |
1268 | 1267 | )] |
1269 | 1268 | pub enum ChildExecutionOutputDescription<S: OutputSpec> { |
1270 | 1269 | /// The process was run and the output was captured. |
|
0 commit comments