pub trait Observer<S>: Namedwhere
S: UsesInput,{
// Provided methods
fn flush(&mut self) -> Result<(), Error> { ... }
fn pre_exec(
&mut self,
_state: &mut S,
_input: &S::Input
) -> Result<(), Error> { ... }
fn post_exec(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error> { ... }
fn pre_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input
) -> Result<(), Error> { ... }
fn post_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error> { ... }
fn observes_stdout(&self) -> bool { ... }
fn observes_stderr(&self) -> bool { ... }
fn observe_stdout(&mut self, stdout: &[u8]) { ... }
fn observe_stderr(&mut self, stderr: &[u8]) { ... }
}
Expand description
Observers observe different information about the target. They can then be used by various sorts of feedback.
Provided Methods§
sourcefn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
The testcase finished execution, calculate any changes. Reserved for future use.
sourcefn pre_exec(&mut self, _state: &mut S, _input: &S::Input) -> Result<(), Error>
fn pre_exec(&mut self, _state: &mut S, _input: &S::Input) -> Result<(), Error>
Called right before execution starts.
sourcefn post_exec(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error>
fn post_exec( &mut self, _state: &mut S, _input: &S::Input, _exit_kind: &ExitKind ) -> Result<(), Error>
Called right after execution finishes.
sourcefn pre_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input
) -> Result<(), Error>
fn pre_exec_child( &mut self, _state: &mut S, _input: &S::Input ) -> Result<(), Error>
Called right before execution starts in the child process, if any.
sourcefn post_exec_child(
&mut self,
_state: &mut S,
_input: &S::Input,
_exit_kind: &ExitKind
) -> Result<(), Error>
fn post_exec_child( &mut self, _state: &mut S, _input: &S::Input, _exit_kind: &ExitKind ) -> Result<(), Error>
Called right after execution finishes in the child process, if any.
sourcefn observes_stdout(&self) -> bool
fn observes_stdout(&self) -> bool
If this observer observes stdout
sourcefn observes_stderr(&self) -> bool
fn observes_stderr(&self) -> bool
If this observer observes stderr
sourcefn observe_stdout(&mut self, stdout: &[u8])
fn observe_stdout(&mut self, stdout: &[u8])
React to new stdout
To use this, always return true
from observes_stdout
sourcefn observe_stderr(&mut self, stderr: &[u8])
fn observe_stderr(&mut self, stderr: &[u8])
React to new stderr
To use this, always return true
from observes_stderr
Implementors§
impl<'a, CM, S, M> Observer<S> for StdCmpObserver<'a, CM, S, M>where
CM: CmpMap + Serialize + DeserializeOwned,
S: UsesInput + Debug + HasMetadata,
M: CmpObserverMetadata<'a, CM>,
impl<'a, S> Observer<S> for BacktraceObserver<'a>where
S: UsesInput,
impl<'a, S, T> Observer<S> for MultiMapObserver<'a, T, false>where
S: UsesInput,
T: 'static + Default + Copy + Serialize + DeserializeOwned + Debug,
Self: MapObserver,
impl<'a, S, T> Observer<S> for MultiMapObserver<'a, T, true>where
S: UsesInput,
T: 'static + Default + Copy + Serialize + DeserializeOwned + Debug,
Self: MapObserver,
impl<'a, S, T> Observer<S> for StdMapObserver<'a, T, false>
impl<'a, S, T> Observer<S> for StdMapObserver<'a, T, true>
impl<'a, S, T> Observer<S> for VariableMapObserver<'a, T>where
S: UsesInput,
T: Default + Copy + 'static + Serialize + DeserializeOwned + Debug + Bounded + PartialEq,
Self: MapObserver,
impl<'a, S, T> Observer<S> for RefCellValueObserver<'a, T>
This does not reset the value inside the observer.
impl<'a, S, T> Observer<S> for ValueObserver<'a, T>
This does not reset the value inside the observer.