forked from llogiq/flamer
-
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 optional prefix string as per llogiq#16
- Loading branch information
1 parent
42cf2df
commit b765eae
Showing
4 changed files
with
82 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,35 @@ | ||
// test double attrs | ||
|
||
#![feature(plugin, custom_attribute)] | ||
#![plugin(flamer)] | ||
#![flame("e")] | ||
|
||
extern crate flame; | ||
|
||
#[flame] | ||
fn a() { | ||
// nothing to do here | ||
} | ||
|
||
fn b() { | ||
a() | ||
} | ||
|
||
#[noflame] | ||
fn c() { | ||
b() | ||
} | ||
|
||
#[test] | ||
fn main() { | ||
c(); | ||
let spans = flame::spans(); | ||
assert_eq!(1, spans.len()); | ||
let roots = &spans[0]; | ||
println!("{:?}",roots); | ||
// if more than 2 roots, a() was flamed twice or c was flamed | ||
// main is missing because main isn't closed here | ||
assert_eq!("e::b", roots.name); | ||
assert_eq!(1, roots.children.len()); | ||
assert_eq!("a", roots.children[0].name); | ||
} |