Is there a way to disable 'dub test' for applications?

Jon D via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 18 11:19:32 PDT 2016


On Monday, 18 April 2016 at 11:47:42 UTC, Dicebot wrote:
> On Monday, 18 April 2016 at 04:25:25 UTC, Jon D wrote:
>> I have an dub config file specifying a targetType of 
>> 'executable'. There is only one file, the file containing 
>> main(), and no unit tests.
>>
>> When I run 'dub test', dub builds and runs the executable. 
>> This is not really desirable. Is there a way to set up the dub 
>> configuration file to disable running the test?
>
> configuration "unittest" {
>     excludedSourceFiles "path/to/main.d"
> }

Very nice, thank you. What also seems to work is:
     configuration "unittest" {
         targetType "none"
     }

Then 'dub test' produces the message:
     Configuration 'unittest' has target type "none". Skipping 
test.





More information about the Digitalmars-d-learn mailing list