how to use dub to run all / chosen dependency lib's unittests

mw mingwu at gmail.com
Tue Sep 20 00:05:41 UTC 2022


On Monday, 19 September 2022 at 23:57:31 UTC, Steven 
Schveighoffer wrote:

>
> I don't see any specific command to do it in dub itself.
>
> I've recently discovered that `dub describe` gives you the 
> directories of all your dependencies in a JSON format.
>
> I used this to write an install script for dependent library 
> artifacts. See 
> [here](https://github.com/schveiguy/raylib-d/blob/master/install/source/app.d).
>
> It would be pretty easy to do the same thing to run dependency 
> unit tests. e.g. something like `foreach(dir; 
> getDubDependencyDirectories) { cd(dir); execute("dub", "test"); 
> }`
>
> You'd have to write getDubDependencyDirectories. But it's just 
> parsing JSON.
>

Thanks. Maybe Python is easier for such glue code.


BTW, does any of the unit test library can do what I want? E.g.

https://code.dlang.org/packages/unit-threaded






More information about the Digitalmars-d-learn mailing list