foundry_test_utils/
macros.rs#[macro_export]
macro_rules! forgetest {
($(#[$attr:meta])* $test:ident, |$prj:ident, $cmd:ident| $e:expr) => {
$crate::forgetest!($(#[$attr])* $test, $crate::foundry_compilers::PathStyle::Dapptools, |$prj, $cmd| $e);
};
($(#[$attr:meta])* $test:ident, $style:expr, |$prj:ident, $cmd:ident| $e:expr) => {
#[allow(clippy::disallowed_macros)]
#[test]
$(#[$attr])*
fn $test() {
let (mut $prj, mut $cmd) = $crate::util::setup_forge(stringify!($test), $style);
$e
}
};
}
#[macro_export]
macro_rules! forgetest_async {
($(#[$attr:meta])* $test:ident, |$prj:ident, $cmd:ident| $e:expr) => {
$crate::forgetest_async!($(#[$attr])* $test, $crate::foundry_compilers::PathStyle::Dapptools, |$prj, $cmd| $e);
};
($(#[$attr:meta])* $test:ident, $style:expr, |$prj:ident, $cmd:ident| $e:expr) => {
#[allow(clippy::disallowed_macros)]
#[tokio::test(flavor = "multi_thread")]
$(#[$attr])*
async fn $test() {
let (mut $prj, mut $cmd) = $crate::util::setup_forge(stringify!($test), $style);
$e
}
};
}
#[macro_export]
macro_rules! casttest {
($(#[$attr:meta])* $test:ident, $($async:ident)? |$prj:ident, $cmd:ident| $e:expr) => {
$crate::casttest!($(#[$attr])* $test, $crate::foundry_compilers::PathStyle::Dapptools, $($async)? |$prj, $cmd| $e);
};
($(#[$attr:meta])* $test:ident, $style:expr, |$prj:ident, $cmd:ident| $e:expr) => {
#[allow(clippy::disallowed_macros)]
#[test]
$(#[$attr])*
fn $test() {
let (mut $prj, mut $cmd) = $crate::util::setup_cast(stringify!($test), $style);
$e
}
};
($(#[$attr:meta])* $test:ident, $style:expr, async |$prj:ident, $cmd:ident| $e:expr) => {
#[allow(clippy::disallowed_macros)]
#[tokio::test(flavor = "multi_thread")]
$(#[$attr])*
async fn $test() {
let (mut $prj, mut $cmd) = $crate::util::setup_cast(stringify!($test), $style);
$e
}
};
}
#[macro_export]
#[allow(clippy::disallowed_macros)]
macro_rules! forgetest_init {
($(#[$attr:meta])* $test:ident, |$prj:ident, $cmd:ident| $e:expr) => {
$crate::forgetest_init!($(#[$attr])* $test, $crate::foundry_compilers::PathStyle::Dapptools, |$prj, $cmd| $e);
};
($(#[$attr:meta])* $test:ident, $style:expr, |$prj:ident, $cmd:ident| $e:expr) => {
#[allow(clippy::disallowed_macros)]
#[test]
$(#[$attr])*
fn $test() {
let (mut $prj, mut $cmd) = $crate::util::setup_forge(stringify!($test), $style);
$crate::util::initialize($prj.root());
$e
}
};
}
#[macro_export]
#[allow(clippy::disallowed_macros)]
macro_rules! forgesoldeer {
($(#[$attr:meta])* $test:ident, |$prj:ident, $cmd:ident| $e:expr) => {
$crate::forgesoldeer!($(#[$attr])* $test, $crate::foundry_compilers::PathStyle::Dapptools, |$prj, $cmd| $e);
};
($(#[$attr:meta])* $test:ident, $style:expr, |$prj:ident, $cmd:ident| $e:expr) => {
#[allow(clippy::disallowed_macros)]
#[test]
$(#[$attr])*
fn $test() {
let (mut $prj, mut $cmd) = $crate::util::setup_forge(stringify!($test), $style);
$crate::util::initialize($prj.root());
$e
}
};
}