This commit is contained in:
Dominik Maier 2020-11-24 01:53:25 +01:00
parent bd09805243
commit 273ea452d8
3 changed files with 10 additions and 1 deletions

View File

@ -385,10 +385,13 @@ mod tests {
use alloc::boxed::Box; use alloc::boxed::Box;
#[cfg(feature = "std")]
use std::io::stderr; use std::io::stderr;
use crate::corpus::{Corpus, InMemoryCorpus, Testcase}; use crate::corpus::{Corpus, InMemoryCorpus, Testcase};
use crate::engines::{Engine, StdEngine, StdState}; use crate::engines::{Engine, StdEngine, StdState};
#[cfg(feature = "std")]
use crate::events::LoggerEventManager; use crate::events::LoggerEventManager;
use crate::executors::inmemory::InMemoryExecutor; use crate::executors::inmemory::InMemoryExecutor;
use crate::executors::{Executor, ExitKind}; use crate::executors::{Executor, ExitKind};
@ -401,6 +404,7 @@ mod tests {
ExitKind::Ok ExitKind::Ok
} }
#[cfg(feature = "std")]
#[test] #[test]
fn test_engine() { fn test_engine() {
let mut rand = StdRand::new(0); let mut rand = StdRand::new(0);

View File

@ -5,13 +5,14 @@ pub mod llmp_translated; // TODO: Abstract away.
#[cfg(feature = "std")] #[cfg(feature = "std")]
pub mod shmem_translated; pub mod shmem_translated;
#[cfg(feature = "std")]
pub use crate::events::llmp::LLMP; pub use crate::events::llmp::LLMP;
use core::any::Any; use core::any::Any;
//use core::any::TypeId; //use core::any::TypeId;
use core::fmt::Display; use core::fmt::Display;
// TODO use core version #[cfg(feature = "std")]
use std::io::Write; use std::io::Write;
use crate::AflError; use crate::AflError;
@ -95,6 +96,7 @@ impl NewTestcaseEvent {
} }
} }
#[cfg(feature = "std")]
pub struct LoggerEventManager<W> pub struct LoggerEventManager<W>
where where
W: Write, W: Write,
@ -103,6 +105,7 @@ where
writer: W, writer: W,
} }
#[cfg(feature = "std")]
impl<S, C, E, I, R, W> EventManager<S, C, E, I, R> for LoggerEventManager<W> impl<S, C, E, I, R, W> EventManager<S, C, E, I, R> for LoggerEventManager<W>
where where
S: State<C, E, I, R>, S: State<C, E, I, R>,
@ -151,6 +154,7 @@ where
} }
} }
#[cfg(feature = "std")]
impl<W> LoggerEventManager<W> impl<W> LoggerEventManager<W>
where where
W: Write, W: Write,

View File

@ -1,5 +1,6 @@
use alloc::rc::Rc; use alloc::rc::Rc;
use alloc::vec::Vec; use alloc::vec::Vec;
use alloc::boxed::Box;
use core::cell::RefCell; use core::cell::RefCell;
use core::marker::PhantomData; use core::marker::PhantomData;
use num::Integer; use num::Integer;