Reputation: 3442
If I define "buildOptions": ["unittests"]
in the root of dub.json
, I get unittests enabled for all builds, e.g. also for release builds. How can enable unittests only for the default build? I.e the build that is triggered by the command dub
?
Upvotes: 2
Views: 311
Reputation: 26569
Try adding this to dub.json
:
"buildTypes": {
"plain": {
"buildOptions": ["unittests", "debugMode", "debugInfo"]
},
}
Note that if this is a library and you release it, then unit tests will be enabled for your library if the library user builds their project with the plain
configuration, which is probably not what you want.
Upvotes: 2