Skip to content

Commit ed83f28

Browse files
committed
Log the synthesized __test module. Issue #428
1 parent ae7b757 commit ed83f28

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/comp/front/test.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import std::option;
44
import std::ivec;
55
import syntax::ast;
66
import syntax::fold;
7+
import syntax::print::pprust;
78
import front::attr;
89

910
export modify_for_testing;
@@ -148,10 +149,13 @@ fn mk_test_module(&test_ctxt cx) -> @ast::item {
148149
items=~[mainfn, testsfn]);
149150
auto item_ = ast::item_mod(testmod);
150151
let ast::item item = rec(ident = "__test",
151-
attrs = ~[],
152-
id = cx.next_node_id(),
153-
node = item_,
154-
span = rec(lo=0u, hi=0u));
152+
attrs = ~[],
153+
id = cx.next_node_id(),
154+
node = item_,
155+
span = rec(lo=0u, hi=0u));
156+
157+
log #fmt("Synthetic test module:\n%s\n", pprust::item_to_str(@item));
158+
155159
ret @item;
156160
}
157161

0 commit comments

Comments
 (0)