Add run-tests command

This commit is contained in:
hkalbasi 2023-06-22 19:33:37 +03:30
parent f0e00ed599
commit 674cd5ab57
8 changed files with 166 additions and 36 deletions

View file

@ -1927,6 +1927,21 @@ impl Function {
db.function_data(self.id).has_async_kw()
}
/// Does this function have `#[test]` attribute?
pub fn is_test(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).attrs.is_test()
}
/// Does this function have the ignore attribute?
pub fn is_ignore(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).attrs.is_ignore()
}
/// Does this function have `#[bench]` attribute?
pub fn is_bench(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).attrs.is_bench()
}
pub fn is_unsafe_to_call(self, db: &dyn HirDatabase) -> bool {
hir_ty::is_fn_unsafe_to_call(db, self.id)
}