Move #[test_case] to a syntax extension
This commit is contained in:
@@ -135,8 +135,14 @@ pub fn expand_test_or_bench(
|
||||
};
|
||||
|
||||
let mut test_const = cx.item(sp, item.ident.gensym(),
|
||||
// #[test_case]
|
||||
vec![cx.attribute(attr_sp, cx.meta_word(attr_sp, Symbol::intern("test_case")))],
|
||||
vec![
|
||||
// #[cfg(test)]
|
||||
cx.attribute(attr_sp, cx.meta_list(attr_sp, Symbol::intern("cfg"), vec![
|
||||
cx.meta_list_item_word(attr_sp, Symbol::intern("test"))
|
||||
])),
|
||||
// #[rustc_test_marker]
|
||||
cx.attribute(attr_sp, cx.meta_word(attr_sp, Symbol::intern("rustc_test_marker")))
|
||||
],
|
||||
// const $ident: test::TestDescAndFn =
|
||||
ast::ItemKind::Const(cx.ty(sp, ast::TyKind::Path(None, test_path("TestDescAndFn"))),
|
||||
// test::TestDescAndFn {
|
||||
|
||||
Reference in New Issue
Block a user