Fix InProcessExecutor test mod
This commit is contained in:
parent
3f1baf90b3
commit
fee9cae8ed
@ -15,6 +15,11 @@ use crate::bolts::os::unix_signals::setup_signal_handler;
|
|||||||
#[cfg(all(windows, feature = "std"))]
|
#[cfg(all(windows, feature = "std"))]
|
||||||
use crate::bolts::os::windows_exceptions::setup_exception_handler;
|
use crate::bolts::os::windows_exceptions::setup_exception_handler;
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
pub use unix_signal_handler::{nop_handler, HandlerFuncPtr};
|
||||||
|
#[cfg(all(windows, feature = "std"))]
|
||||||
|
pub use windows_exception_handler::{nop_handler, HandlerFuncPtr};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::Corpus,
|
corpus::Corpus,
|
||||||
events::{EventFirer, EventRestarter},
|
events::{EventFirer, EventRestarter},
|
||||||
@ -39,14 +44,11 @@ where
|
|||||||
/// The observers, observing each run
|
/// The observers, observing each run
|
||||||
observers: OT,
|
observers: OT,
|
||||||
/// On crash C function pointer
|
/// On crash C function pointer
|
||||||
#[cfg(unix)]
|
#[cfg(any(unix, all(windows, feature = "std")))]
|
||||||
crash_handler: unix_signal_handler::HandlerFuncPtr,
|
crash_handler: HandlerFuncPtr,
|
||||||
/// On timeout C function pointer
|
/// On timeout C function pointer
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
timeout_handler: unix_signal_handler::HandlerFuncPtr,
|
timeout_handler: HandlerFuncPtr,
|
||||||
/// On crash C function pointer
|
|
||||||
#[cfg(all(windows, feature = "std"))]
|
|
||||||
crash_handler: windows_exception_handler::HandlerFuncPtr,
|
|
||||||
phantom: PhantomData<(I, S)>,
|
phantom: PhantomData<(I, S)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,7 +303,7 @@ mod unix_signal_handler {
|
|||||||
unsafe impl Send for InProcessExecutorHandlerData {}
|
unsafe impl Send for InProcessExecutorHandlerData {}
|
||||||
unsafe impl Sync for InProcessExecutorHandlerData {}
|
unsafe impl Sync for InProcessExecutorHandlerData {}
|
||||||
|
|
||||||
unsafe fn nop_handler(
|
pub unsafe fn nop_handler(
|
||||||
_signal: Signal,
|
_signal: Signal,
|
||||||
_info: siginfo_t,
|
_info: siginfo_t,
|
||||||
_context: &mut ucontext_t,
|
_context: &mut ucontext_t,
|
||||||
@ -605,7 +607,7 @@ mod windows_exception_handler {
|
|||||||
unsafe impl Send for InProcessExecutorHandlerData {}
|
unsafe impl Send for InProcessExecutorHandlerData {}
|
||||||
unsafe impl Sync for InProcessExecutorHandlerData {}
|
unsafe impl Sync for InProcessExecutorHandlerData {}
|
||||||
|
|
||||||
unsafe fn nop_handler(
|
pub unsafe fn nop_handler(
|
||||||
_code: ExceptionCode,
|
_code: ExceptionCode,
|
||||||
_exception_pointers: *mut EXCEPTION_POINTERS,
|
_exception_pointers: *mut EXCEPTION_POINTERS,
|
||||||
_data: &mut InProcessExecutorHandlerData,
|
_data: &mut InProcessExecutorHandlerData,
|
||||||
@ -728,7 +730,7 @@ mod tests {
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
bolts::tuples::tuple_list,
|
bolts::tuples::tuple_list,
|
||||||
executors::{Executor, ExitKind, InProcessExecutor},
|
executors::{inprocess, Executor, ExitKind, InProcessExecutor},
|
||||||
inputs::NopInput,
|
inputs::NopInput,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -739,6 +741,10 @@ mod tests {
|
|||||||
let mut in_process_executor = InProcessExecutor::<_, NopInput, (), ()> {
|
let mut in_process_executor = InProcessExecutor::<_, NopInput, (), ()> {
|
||||||
harness_fn: &mut harness,
|
harness_fn: &mut harness,
|
||||||
observers: tuple_list!(),
|
observers: tuple_list!(),
|
||||||
|
#[cfg(any(unix, all(windows, feature = "std")))]
|
||||||
|
crash_handler: inprocess::nop_handler,
|
||||||
|
#[cfg(unix)]
|
||||||
|
timeout_handler: inprocess::nop_handler,
|
||||||
phantom: PhantomData,
|
phantom: PhantomData,
|
||||||
};
|
};
|
||||||
let input = NopInput {};
|
let input = NopInput {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user