Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make a ui test to take the role of libproc_macro #[test] tests
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// force-host | ||
// no-prefer-dynamic | ||
|
||
#![crate_type = "proc-macro"] | ||
#![crate_name = "proc_macro_api_tests"] | ||
#![deny(dead_code)] // catch if a test function is never called | ||
|
||
extern crate proc_macro; | ||
|
||
use proc_macro::TokenStream; | ||
|
||
#[proc_macro] | ||
pub fn run(input: TokenStream) -> TokenStream { | ||
assert!(input.is_empty()); | ||
TokenStream::new() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// check-pass | ||
// aux-build:api/mod.rs | ||
|
||
//! This is for everything that *would* be a #[test] inside of libproc_macro, | ||
//! except for the fact that proc_macro objects are not capable of existing | ||
//! inside of an ordinary Rust test execution, only inside a macro. | ||
|
||
extern crate proc_macro_api_tests; | ||
|
||
proc_macro_api_tests::run!(); | ||
|
||
fn main() {} |