Selective unittesting in DUB

Виталий Фадеев vital.fadeev at gmail.com
Tue Dec 1 07:40:12 UTC 2020


https://forum.dlang.org/post/owhmsgkhszkwcjkxlqyx@forum.dlang.org

On Wednesday, 21 December 2016 at 18:07:23 UTC, Nordlöw wrote:
> Is there a way to specify in dub.json (or any other file) that 
> only a subset of the sources compiled and linked to a library 
> or app should have they're unittests enabled?

Check this one:

app.d
------
Version ( DoubleBuffer )
{
   unittest
   {
     // ...
   }
}
else
{
   unittest
   {
     // ...
   }
}



or

unittest
{
   Version ( DoubleBuffer )
   {
       // ...
   }
   // ...
}


dub.json
--------
{
     ...,
     "buildTypes":
     {
         "debug":
         {
             "versions": [ "DoubleBuffer" ]
         }
     }
}

How to specify "DoubleBuffer" via dub's command line?...

I think you can improve the dub.



More information about the Digitalmars-d-learn mailing list