Re: Selective unittesting in DUB
Am 01.12.20 um 08:11 schrieb ryuukk_: > Running .\dawn-test-application.exe > 2 modules passed unittests > > > Wich ones? it should print > > > ``` > Running tests for target X > > - src/module_a.d Tests: OK <-- line in green > - src/module_b.d Tests: OK > - src/module_c.d Tests: OK > - src/module_e.d Tests: FAIL <-- line in red > > 3 modules passed, 1 failed > > ``` > > >From what I understand, the default test runner is intentionally being kept quite simple. There are some libraries that provide test runners that do what you expect (e.g. [1], [2], [3], there is probably more). [1] https://code.dlang.org/packages/silly [2] https://code.dlang.org/packages/unit-threaded [3] https://code.dlang.org/packages/trial
Re: Selective unittesting in DUB
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" ] } } } Or may be "pragma" can help you... version ( Windows ) { pragma( lib, "gdi32.lib" ); } How to specify "DoubleBuffer" via dub's command line?...
Selective unittesting in DUB
https://forum.dlang.org/post/owhmsgkhszkwcjkxl...@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.
Re: Selective unittesting in DUB
Running .\dawn-test-application.exe 2 modules passed unittests Wich ones? it should print ``` Running tests for target X - src/module_a.d Tests: OK <-- line in green - src/module_b.d Tests: OK - src/module_c.d Tests: OK - src/module_e.d Tests: FAIL <-- line in red 3 modules passed, 1 failed ```
Re: Selective unittesting in DUB
On Wednesday, 21 December 2016 at 19:49:20 UTC, Jacob Carlborg wrote: On 2016-12-21 19:07, 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? You can use the "unittest" configuration in Dub to add or remove files, but I don't think you can disable some of the unittest blocks in a single module. There's also unit-threaded [1] which allows you to run specific unit tests. [1] https://github.com/atilaneves/unit-threaded I was looking for an answser to that question I am sorry but this should be supported out of the box Nobody should have to download ton of dependencies to make such basic and needed feature to work... i should be able to do: dub test src/module.d ... this is very disappointing
Re: Selective unittesting in DUB
On 2016-12-21 19:07, 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? You can use the "unittest" configuration in Dub to add or remove files, but I don't think you can disable some of the unittest blocks in a single module. There's also unit-threaded [1] which allows you to run specific unit tests. [1] https://github.com/atilaneves/unit-threaded -- /Jacob Carlborg
Selective unittesting in DUB
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?