Add support for running tests in no_std mode.

This commit is contained in:
Dan Gohman
2018-01-18 22:05:51 -08:00
parent 023f8d7980
commit 61db54c447
43 changed files with 101 additions and 13 deletions

View File

@@ -1039,7 +1039,12 @@ mod tests {
let flags = settings::Flags::new(&settings::builder());
match verify_function(&func, &flags) {
Ok(()) => {}
Err(err) => panic!(err.message),
Err(err) => {
#[cfg(not(feature = "no_std"))]
panic!(err.message);
#[cfg(feature = "no_std")]
panic!("function failed to verify");
}
}
}
@@ -1213,7 +1218,12 @@ mod tests {
let flags = settings::Flags::new(&settings::builder());
match verify_function(&func, &flags) {
Ok(()) => {}
Err(err) => panic!(err.message),
Err(err) => {
#[cfg(not(feature = "no_std"))]
panic!(err.message);
#[cfg(feature = "no_std")]
panic!("function failed to verify");
}
}
}
@@ -1259,7 +1269,12 @@ mod tests {
let flags = settings::Flags::new(&settings::builder());
match verify_function(&func, &flags) {
Ok(()) => {}
Err(err) => panic!(err.message),
Err(err) => {
#[cfg(not(feature = "no_std"))]
panic!(err.message);
#[cfg(feature = "no_std")]
panic!("function failed to verify");
}
}
}
}