digitalmars.D.learn - hijack dub test
- Nicholas Wilson (12/12) Aug 30 2017 My project is a library, but I also need to test it and unit
- Jacob Carlborg (7/14) Aug 31 2017 "The configuration name "unittest" has a special meaning - if a
- Nicholas Wilson (2/15) Aug 31 2017 Thanks!
My project is a library, but I also need to test it and unit tests won't cut it (external hardware). How do you set up the dub.json to build the library normally but when it is invoked with `dub test` it runs a separate configuration that also includes files in the `source/test` folder, but are excluded when not testing. If thats not possible how does one specify that `source/test` should not be built when building a library and only `source/test` should be built when doing tests, but the tester depend in the library? Thanks Nic
Aug 30 2017
On 2017-08-31 08:41, Nicholas Wilson wrote:My project is a library, but I also need to test it and unit tests won't cut it (external hardware). How do you set up the dub.json to build the library normally but when it is invoked with `dub test` it runs a separate configuration that also includes files in the `source/test` folder, but are excluded when not testing."The configuration name "unittest" has a special meaning - if a configuration with this name is present, it will be used by default when executing dub test." [1] [1] http://code.dlang.org/package-format?lang=json#configurations -- /Jacob Carlborg
Aug 31 2017
On Thursday, 31 August 2017 at 07:04:13 UTC, Jacob Carlborg wrote:On 2017-08-31 08:41, Nicholas Wilson wrote:Thanks!My project is a library, but I also need to test it and unit tests won't cut it (external hardware). How do you set up the dub.json to build the library normally but when it is invoked with `dub test` it runs a separate configuration that also includes files in the `source/test` folder, but are excluded when not testing."The configuration name "unittest" has a special meaning - if a configuration with this name is present, it will be used by default when executing dub test." [1] [1] http://code.dlang.org/package-format?lang=json#configurations
Aug 31 2017