[Issue 2749] Make unittests named and nestable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 19 16:07:07 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2749





------- Comment #3 from shro8822 at vandals.uidaho.edu  2009-03-19 18:07 -------
OK so it takes a little boilerplate.

unitests
{
   static const name = "Foo";

   if(!RunTestByName(name)) return;
   try
   {

   /// tests

   }
   catch(Excption e)
   {
      ProcessUnittestError(name,e);
   }
}

Or to be even cleaner

unittest
{
   RunTests!(Foo, Bar, Baz)();
}

void Foo() { /* tests */ }
void Bar() { /* tests */ }
void Baz() { /* tests */ }


-- 



More information about the Digitalmars-d-bugs mailing list