comparison dmd/UnitTestDeclaration.d @ 187:b0d41ff5e0df

Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
author Abscissa
date Tue, 07 Jun 2011 23:37:34 -0400
parents cd48cb899aee
children
comparison
equal deleted inserted replaced
186:1a0c1126bc46 187:b0d41ff5e0df
15 import dmd.Module; 15 import dmd.Module;
16 import dmd.STC; 16 import dmd.STC;
17 import dmd.Lexer; 17 import dmd.Lexer;
18 import dmd.Identifier; 18 import dmd.Identifier;
19 19
20 import dmd.DDMDExtensions;
21
20 /******************************* 22 /*******************************
21 * Generate unique unittest function Id so we can have multiple 23 * Generate unique unittest function Id so we can have multiple
22 * instances per module. 24 * instances per module.
23 */ 25 */
24 Identifier unitTestId() 26 Identifier unitTestId()
26 return Lexer.uniqueId("__unittest"); 28 return Lexer.uniqueId("__unittest");
27 } 29 }
28 30
29 class UnitTestDeclaration : FuncDeclaration 31 class UnitTestDeclaration : FuncDeclaration
30 { 32 {
33 mixin insertMemberExtension!(typeof(this));
34
31 this(Loc loc, Loc endloc) 35 this(Loc loc, Loc endloc)
32 { 36 {
33 register(); 37 register();
34 super(loc, endloc, unitTestId(), STC.STCundefined, null); 38 super(loc, endloc, unitTestId(), STC.STCundefined, null);
35 } 39 }