Thread overview
how to use dub to run all / chosen dependency lib's unittests
Sep 19
mw
Sep 20
mw
September 19

Hi,

I'm using dub.json to specify the dependencies libs for my project.

I'm just wondering how I can use dub to run all the tests of those dependencies libs (of the transitive closure of all the libs) to make sure my project is built on a very solid foundation?

I know this could be very time-consuming, probably will run it over-night.

On the other hand, what's the command to run dub test on a single dependency lib?

Thanks.

September 19

On 9/19/22 7:48 PM, mw wrote:

>

Hi,

I'm using dub.json to specify the dependencies libs for my project.

I'm just wondering how I can use dub to run all the tests of those dependencies libs (of the transitive closure of all the libs) to make sure my project is built on a very solid foundation?

I know this could be very time-consuming, probably will run it over-night.

On the other hand, what's the command to run dub test on a single dependency lib?

Thanks.

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.

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.

-Steve

September 20

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.

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