digitalmars.D.learn - Selective unittesting in DUB
- =?UTF-8?B?Tm9yZGzDtnc=?= (3/3) Dec 21 2016 Is there a way to specify in dub.json (or any other file) that
- Jacob Carlborg (8/11) Dec 21 2016 You can use the "unittest" configuration in Dub to add or remove files,
- ryuukk_ (9/21) Nov 30 2020 I was looking for an answser to that question
- ryuukk_ (11/11) Nov 30 2020 Running .\dawn-test-application.exe
- Johannes Loher (7/27) Dec 01 2020 From what I understand, the default test runner is intentionally being
- =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= (45/48) Nov 30 2020 Check this one:
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?
Dec 21 2016
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
Dec 21 2016
On Wednesday, 21 December 2016 at 19:49:20 UTC, Jacob Carlborg wrote:On 2016-12-21 19:07, Nordlöw wrote: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 disappointingIs 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
Nov 30 2020
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 ```
Nov 30 2020
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
Dec 01 2020
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?...
Nov 30 2020