forked from Manishearth/compiletest-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a proc-macro UI test example to the test project
Taken from work on rust-lang/rust-clippy#3741. I think this is a useful test to have because it tests * the `run-pass` header * the `aux-build` header, building auxiliary files * the `no-prefer-dynamic` header * proc-macro crate interactions with all of the above * running of UI tests that include auxiliary files There's no tests for any of the above right now.
- Loading branch information
Showing
3 changed files
with
35 additions
and
7 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,12 @@ | ||
// no-prefer-dynamic | ||
|
||
#![crate_type = "proc-macro"] | ||
|
||
extern crate proc_macro; | ||
|
||
use proc_macro::{TokenStream}; | ||
|
||
#[proc_macro] | ||
pub fn macro_test(input_stream: TokenStream) -> TokenStream { | ||
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,13 @@ | ||
// run-pass | ||
// aux-build:simple_proc_macro.rs | ||
|
||
#![feature(proc_macro_hygiene)] | ||
|
||
extern crate simple_proc_macro; | ||
use simple_proc_macro::macro_test; | ||
|
||
fn main() { | ||
println!("hi"); | ||
macro_test!(2); | ||
} | ||
|
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