@@ -40,29 +40,32 @@ pub mod inner;
40
40
pub mod stateful;
41
41
42
42
/// The process executor simply calls a target function, as mutable reference to a closure.
43
- pub type InProcessExecutor < ' a , H , I , OT , S > = GenericInProcessExecutor < H , & ' a mut H , ( ) , I , OT , S > ;
43
+ pub type InProcessExecutor < ' a , EM , H , I , OT , S , Z > =
44
+ GenericInProcessExecutor < EM , H , & ' a mut H , ( ) , I , OT , S , Z > ;
44
45
45
46
/// The inprocess executor that allows hooks
46
- pub type HookableInProcessExecutor < ' a , H , HT , I , OT , S > =
47
- GenericInProcessExecutor < H , & ' a mut H , HT , I , OT , S > ;
47
+ pub type HookableInProcessExecutor < ' a , EM , H , HT , I , OT , S , Z > =
48
+ GenericInProcessExecutor < EM , H , & ' a mut H , HT , I , OT , S , Z > ;
48
49
/// The process executor simply calls a target function, as boxed `FnMut` trait object
49
- pub type OwnedInProcessExecutor < I , OT , S > = GenericInProcessExecutor <
50
+ pub type OwnedInProcessExecutor < EM , I , OT , S , Z > = GenericInProcessExecutor <
51
+ EM ,
50
52
dyn FnMut ( & I ) -> ExitKind ,
51
53
Box < dyn FnMut ( & I ) -> ExitKind > ,
52
54
( ) ,
53
55
I ,
54
56
OT ,
55
57
S ,
58
+ Z ,
56
59
> ;
57
60
58
61
/// The inmem executor simply calls a target function, then returns afterwards.
59
- pub struct GenericInProcessExecutor < H , HB , HT , I , OT , S > {
62
+ pub struct GenericInProcessExecutor < EM , H , HB , HT , I , OT , S , Z > {
60
63
harness_fn : HB ,
61
- inner : GenericInProcessExecutorInner < HT , I , OT , S > ,
64
+ inner : GenericInProcessExecutorInner < EM , HT , I , OT , S , Z > ,
62
65
phantom : PhantomData < ( * const H , HB ) > ,
63
66
}
64
67
65
- impl < H , HB , HT , I , OT , S > Debug for GenericInProcessExecutor < H , HB , HT , I , OT , S >
68
+ impl < EM , H , HB , HT , I , OT , S , Z > Debug for GenericInProcessExecutor < EM , H , HB , HT , I , OT , S , Z >
66
69
where
67
70
OT : Debug ,
68
71
{
75
78
}
76
79
77
80
impl < EM , H , HB , HT , I , OT , S , Z > Executor < EM , I , S , Z >
78
- for GenericInProcessExecutor < H , HB , HT , I , OT , S >
81
+ for GenericInProcessExecutor < EM , H , HB , HT , I , OT , S , Z >
79
82
where
80
83
S : HasExecutions ,
81
84
OT : ObserversTuple < I , S > ,
@@ -106,7 +109,9 @@ where
106
109
}
107
110
}
108
111
109
- impl < H , HB , HT , I , OT , S > HasObservers for GenericInProcessExecutor < H , HB , HT , I , OT , S > {
112
+ impl < EM , H , HB , HT , I , OT , S , Z > HasObservers
113
+ for GenericInProcessExecutor < EM , H , HB , HT , I , OT , S , Z >
114
+ {
110
115
type Observers = OT ;
111
116
112
117
#[ inline]
@@ -120,15 +125,15 @@ impl<H, HB, HT, I, OT, S> HasObservers for GenericInProcessExecutor<H, HB, HT, I
120
125
}
121
126
}
122
127
123
- impl < ' a , H , I , OT , S > InProcessExecutor < ' a , H , I , OT , S >
128
+ impl < ' a , EM , H , I , OT , S , Z > InProcessExecutor < ' a , EM , H , I , OT , S , Z >
124
129
where
125
130
H : FnMut ( & I ) -> ExitKind + Sized ,
126
131
OT : ObserversTuple < I , S > ,
127
132
S : HasCurrentTestcase < I > + HasExecutions + HasSolutions < I > ,
128
133
I : Input ,
129
134
{
130
135
/// Create a new in mem executor with the default timeout (5 sec)
131
- pub fn new < EM , OF , Z > (
136
+ pub fn new < OF > (
132
137
harness_fn : & ' a mut H ,
133
138
observers : OT ,
134
139
fuzzer : & mut Z ,
@@ -140,7 +145,7 @@ where
140
145
OF : Feedback < EM , I , OT , S > ,
141
146
Z : HasObjective < Objective = OF > ,
142
147
{
143
- Self :: with_timeout_generic :: < EM , OF , Z > (
148
+ Self :: with_timeout_generic :: < OF > (
144
149
tuple_list ! ( ) ,
145
150
harness_fn,
146
151
observers,
@@ -153,7 +158,7 @@ where
153
158
154
159
/// Create a new in mem executor with the default timeout and use batch mode(5 sec)
155
160
#[ cfg( all( feature = "std" , target_os = "linux" ) ) ]
156
- pub fn batched_timeout < EM , OF , Z > (
161
+ pub fn batched_timeout < OF > (
157
162
harness_fn : & ' a mut H ,
158
163
observers : OT ,
159
164
fuzzer : & mut Z ,
@@ -166,7 +171,7 @@ where
166
171
OF : Feedback < EM , I , OT , S > ,
167
172
Z : HasObjective < Objective = OF > ,
168
173
{
169
- let inner = GenericInProcessExecutorInner :: batched_timeout_generic :: < Self , EM , OF , Z > (
174
+ let inner = GenericInProcessExecutorInner :: batched_timeout_generic :: < Self , OF > (
170
175
tuple_list ! ( ) ,
171
176
observers,
172
177
fuzzer,
@@ -190,7 +195,7 @@ where
190
195
/// * `observers` - the observers observing the target during execution
191
196
///
192
197
/// This may return an error on unix, if signal handler setup fails
193
- pub fn with_timeout < EM , OF , Z > (
198
+ pub fn with_timeout < OF > (
194
199
harness_fn : & ' a mut H ,
195
200
observers : OT ,
196
201
fuzzer : & mut Z ,
@@ -203,7 +208,7 @@ where
203
208
OF : Feedback < EM , I , OT , S > ,
204
209
Z : HasObjective < Objective = OF > ,
205
210
{
206
- let inner = GenericInProcessExecutorInner :: with_timeout_generic :: < Self , EM , OF , Z > (
211
+ let inner = GenericInProcessExecutorInner :: with_timeout_generic :: < Self , OF > (
207
212
tuple_list ! ( ) ,
208
213
observers,
209
214
fuzzer,
@@ -220,7 +225,7 @@ where
220
225
}
221
226
}
222
227
223
- impl < H , HB , HT , I , OT , S > GenericInProcessExecutor < H , HB , HT , I , OT , S >
228
+ impl < EM , H , HB , HT , I , OT , S , Z > GenericInProcessExecutor < EM , H , HB , HT , I , OT , S , Z >
224
229
where
225
230
H : FnMut ( & I ) -> ExitKind + Sized ,
226
231
HB : BorrowMut < H > ,
@@ -230,7 +235,7 @@ where
230
235
I : Input ,
231
236
{
232
237
/// Create a new in mem executor with the default timeout (5 sec)
233
- pub fn generic < EM , OF , Z > (
238
+ pub fn generic < OF > (
234
239
user_hooks : HT ,
235
240
harness_fn : HB ,
236
241
observers : OT ,
@@ -243,7 +248,7 @@ where
243
248
OF : Feedback < EM , I , OT , S > ,
244
249
Z : HasObjective < Objective = OF > ,
245
250
{
246
- Self :: with_timeout_generic :: < EM , OF , Z > (
251
+ Self :: with_timeout_generic :: < OF > (
247
252
user_hooks,
248
253
harness_fn,
249
254
observers,
@@ -256,7 +261,7 @@ where
256
261
257
262
/// Create a new in mem executor with the default timeout and use batch mode(5 sec)
258
263
#[ cfg( all( feature = "std" , target_os = "linux" ) ) ]
259
- pub fn batched_timeout_generic < EM , OF , Z > (
264
+ pub fn batched_timeout_generic < OF > (
260
265
user_hooks : HT ,
261
266
harness_fn : HB ,
262
267
observers : OT ,
@@ -271,7 +276,7 @@ where
271
276
OF : Feedback < EM , I , OT , S > ,
272
277
Z : HasObjective < Objective = OF > ,
273
278
{
274
- let inner = GenericInProcessExecutorInner :: batched_timeout_generic :: < Self , EM , OF , Z > (
279
+ let inner = GenericInProcessExecutorInner :: batched_timeout_generic :: < Self , OF > (
275
280
user_hooks, observers, fuzzer, state, event_mgr, exec_tmout,
276
281
) ?;
277
282
@@ -290,7 +295,7 @@ where
290
295
/// * `observers` - the observers observing the target during execution
291
296
///
292
297
/// This may return an error on unix, if signal handler setup fails
293
- pub fn with_timeout_generic < EM , OF , Z > (
298
+ pub fn with_timeout_generic < OF > (
294
299
user_hooks : HT ,
295
300
harness_fn : HB ,
296
301
observers : OT ,
@@ -304,7 +309,7 @@ where
304
309
OF : Feedback < EM , I , OT , S > ,
305
310
Z : HasObjective < Objective = OF > ,
306
311
{
307
- let inner = GenericInProcessExecutorInner :: with_timeout_generic :: < Self , EM , OF , Z > (
312
+ let inner = GenericInProcessExecutorInner :: with_timeout_generic :: < Self , OF > (
308
313
user_hooks, observers, fuzzer, state, event_mgr, timeout,
309
314
) ?;
310
315
@@ -349,8 +354,8 @@ pub trait HasInProcessHooks<I, S> {
349
354
fn inprocess_hooks_mut ( & mut self ) -> & mut InProcessHooks < I , S > ;
350
355
}
351
356
352
- impl < H , HB , HT , I , OT , S > HasInProcessHooks < I , S >
353
- for GenericInProcessExecutor < H , HB , HT , I , OT , S >
357
+ impl < EM , H , HB , HT , I , OT , S , Z > HasInProcessHooks < I , S >
358
+ for GenericInProcessExecutor < EM , H , HB , HT , I , OT , S , Z >
354
359
{
355
360
/// the timeout handler
356
361
#[ inline]
0 commit comments