On 2012-12-16 19:39, bioinfornatics wrote:
Dear,

I would like to understand if to have an empty main file ils need to use
unittest.

I explain i have a library with some unittest section

-- foo.d--

void doFoo(){ ... }
unittest{
   scope(success) writeln( "ok" );
   scope(failure) writeln( "no" );
   doFoo();
}
------


to use unittest i need to have main file which import each library
module as

--- main.d- --
import foo1, foo2, foo3;

void main(){}
-------

why they are not a dflag to do this?

Maybe that is me where is use badly d unittest

You don't necessarily need to import the other files. As long as all files are compiled it should run the unit tests for all files.

You do need a main function.

--
/Jacob Carlborg

Reply via email to