You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
692 B

macro_rules! test_end {
() => (
println!("Test end");
// test success
unsafe{ arch::cpu::exit_in_qemu(11) }
)
}
macro_rules! test {
// ($name:expr, $body:expr) => (
// if cfg!(feature = "test") {
// println!("Testing: {}", $name);
// $body;
// println!("Success: {}", $name);
// }
// );
($func:ident) => (
if cfg!(feature = "test") {
println!("Testing: {}", stringify!($func));
use self::test::$func;
test::$func();
println!("Success: {}", stringify!($func));
}
)
}
macro_rules! no_interrupt {
{$func:block} => {
use arch::interrupt;
unsafe{ interrupt::disable(); }
$func;
unsafe{ interrupt::enable(); }
};
}