Skip testing two mono tests for now

This commit is contained in:
Ayaz Hafiz 2022-12-03 22:43:19 -06:00
parent 01dea13b49
commit e296d35bcd
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 12 additions and 7 deletions

View file

@ -1,11 +1,14 @@
//! Macros for use in `test_mono`.
extern crate proc_macro;
use proc_macro::TokenStream;
use proc_macro::{TokenStream, TokenTree};
use quote::quote;
#[proc_macro_attribute]
pub fn mono_test(_args: TokenStream, item: TokenStream) -> TokenStream {
pub fn mono_test(args: TokenStream, item: TokenStream) -> TokenStream {
let no_check = args
.into_iter()
.any(|tok| matches!(tok, TokenTree::Ident(id) if id.to_string() == "no_check"));
let task_fn = syn::parse_macro_input!(item as syn::ItemFn);
let args = task_fn.sig.inputs.clone();
@ -21,7 +24,7 @@ pub fn mono_test(_args: TokenStream, item: TokenStream) -> TokenStream {
#[test]
#(#attributes)*
#visibility fn #name(#args) {
compiles_to_ir(#name_str, #body);
compiles_to_ir(#name_str, #body, #no_check);
}
};