DUB-TEST(1)
π
dub-test(1) β ok so this is the dub test page, bestie
So this is a page from the manual of The D Language Foundation, and it's literally all about running your unit tests. Buckle up, it's actually so good.
β¨ NAME β¨
dub-test β runs the tests of the package you picked, periodt π
π SYNOPSIS π
dub test [<package>[@<version-spec>]] OPTIONS... [-- <application
arguments...>]
π¦ DESCRIPTION π¦
It builds the package and then executes, like, all the unit tests inside it. Slay.
If you don't hand it an explicit configuration, then an existing "unittest" configuration gets preferred for testing β it's giving main character energy, obviously. And if there's no "unittest" one? Then the first library type configuration gets used. And if that doesn't exist either, then the first executable configuration is the one chosen. It's a whole vibe check cascade, iykyk.
When you specify a custom main file (--main-file), it's lowkey restrictive: only library configurations can be used. Otherwise, depending on the type of the configuration you selected, either an existing main file will be used β and ngl, that one needs to be properly adjusted to just run the unit tests for version(unittest) β or DUB will generate one for you for library type configurations. Cute of it π«Ά
And finally (the finale β¨): if the package contains a dependency to the "tested" package, the automatically generated main file will use it to run the unit tests. Obsessed.
π₯ OPTIONS π₯
--temp-buildβ builds the project in the temp folder if it's possible to do that.--main-file=VALUEβ specifies a custom file containing themain()function to use for running the tests.--combinedβ tries to build the whole entire project in a single compiler run. one shot, one opportunity.--parallelβ runs multiple compiler instances in parallel, if possible.-f,--forceβ forces a recompilation even if the target is already up to date.--coverageβ enables code coverage statistics to be generated.--coverage-ctfeβ enables code coverage (including CTFE π) statistics to be generated.--dest=VALUEβ base directory in which output atifacts will be placed.-b,--build=VALUEβ specifies the type of build to perform. Note that setting theDFLAGSenvironment variable will override the build type with custom flags (yes, it just takes over, rude but iconic). Possible names:
debug, plain, release, release-debug, release-nobounds, unittest,
profile, profile-gc, docs, ddox, cov, cov-ctfe, unittest-cov,
unittest-cov-ctfe, syntax and custom types
-c,--config=VALUEβ builds the specified configuration. Configurations can be defined indub.json.--override-config=VALUEβ uses the specified configuration for a certain dependency. Can be specified multiple times. Format:--override-config=<dependency>/<config>--compiler=VALUEβ specifies the compiler binary to use (can be a path). Arbitrary pre- and suffixes to the identifiers below are recognized (e.g.ldc2ordmd-2.063) and matched to the proper compiler type:
dmd, gdc, ldc, gdmd, ldmd
-a,--arch=VALUEβ forces a different architecture (e.g.x86orx86_64).-d,--debug=VALUEβ defines the specifieddebugversion identifier when building β can be used multiple times.--d-version=VALUEβ defines the specifiedversionidentifier when building β can be used multiple times. Use sparingly, because with great power comes great responsibility! π·οΈ For commonly used or combined versions, and versions that dependees should be able to use, create configurations in your package instead.--nodepsβ do not resolve missing dependencies before building.--build-mode=VALUEβ specifies the way the compiler and linker are invoked. Valid values:
separate (default), allAtOnce, singleFile
--singleβ treats the package name as a filename. The file must contain a package recipe comment.--force-removeβ deprecated option that does nothing. literally nothing. it's just there. π--filter-versionsβ [Experimental] filter version identifiers and debug version identifiers to improve build cache efficiency.
π COMMON OPTIONS π
See dub(1) β the mothership page, go say hi.
π EXIT STATUS π
0β DUB succeeded π1β usage errors, unknown command line flags π2β package not found, package failed to load, miscellaneous error π
π FILES π
dub.sdl,dub.json
π§ AUTHOR π§
Copyright (c) 1999-2026 by The D Language Foundation
β ONLINE DOCUMENTATION β
http://code.dlang.org/docs/commandline β¨β©
π SEE ALSO π
ok that's the whole page bestie, you ate that π«Ά this was brought to you by The D Language Foundation, dated 2026-08-16 β go run some tests, ily, bye π β¨
π¦ where this page comes from
- arch rolling: dub 1.42.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms