1DUB-TEST(1)                The D Language Foundation               DUB-TEST(1)
2
3
4

NAME

6       dub-test - Executes the tests of the selected package
7

SYNOPSIS

9       dub  test [<package>[@<version-spec>]] OPTIONS...  [-- <application ar‐
10       guments...>]
11

DESCRIPTION

13       Builds the package and executes all contained unit tests.
14
15
16
17       If no explicit configuration is given, an existing "unittest"  configu‐
18       ration will be preferred for testing. If none exists, the first library
19       type configuration will be used, and if that doesn't exist either,  the
20       first executable configuration is chosen.
21
22
23
24       When  a  custom main file (--main-file) is specified, only library con‐
25       figurations can be used. Otherwise, depending on the type  of  the  se‐
26       lected  configuration,  either  an existing main file will be used (and
27       needs to be properly adjusted to just run  the  unit  tests  for  'ver‐
28       sion(unittest)'),  or DUB will generate one for library type configura‐
29       tions.
30
31
32
33       Finally, if the package contains a dependency to the "tested"  package,
34       the  automatically  generated  main  file  will  use it to run the unit
35       tests.
36

OPTIONS

38       --temp-build
39           Builds the project in the temp folder if possible.
40
41       --main-file=VALUE
42           Specifies a custom file containing the main() function to  use  for
43           running the tests.
44
45       --combined
46           Tries to build the whole project in a single compiler run.
47
48       --parallel
49           Runs multiple compiler instances in parallel, if possible.
50
51       -f, --force
52           Forces a recompilation even if the target is up to date
53
54       --coverage
55           Enables code coverage statistics to be generated.
56
57       --coverage-ctfe
58           Enables code coverage (including CTFE) statistics to be generated.
59
60       -b, --build=VALUE
61           Specifies  the  type  of  build  to  perform. Note that setting the
62           DFLAGS environment variable will override the build type with  cus‐
63           tom flags.  Possible names:
64             debug, plain, release, release-debug, release-nobounds, unittest,
65           profile,  profile-gc,  docs,  ddox,  cov,  cov-ctfe,  unittest-cov,
66           unittest-cov-ctfe, syntax and custom types
67
68       -c, --config=VALUE
69           Builds  the  specified configuration. Configurations can be defined
70           in dub.json
71
72       --override-config=VALUE
73           Uses the specified configuration for a certain dependency.  Can  be
74           specified   multiple   times.    Format:  --override-config=<depen‐
75           dency>/<config>
76
77       --compiler=VALUE
78           Specifies the compiler binary to use (can be  a  path).   Arbitrary
79           pre-  and  suffixes  to  the identifiers below are recognized (e.g.
80           ldc2 or dmd-2.063) and matched to the proper compiler type:
81             dmd, gdc, ldc, gdmd, ldmd
82
83       -a, --arch=VALUE
84           Force a different architecture (e.g. x86 or x86_64)
85
86       -d, --debug=VALUE
87           Define the specified debug version identifier when building  -  can
88           be used multiple times
89
90       --nodeps
91           Do not resolve missing dependencies before building
92
93       --build-mode=VALUE
94           Specifies  the  way the compiler and linker are invoked. Valid val‐
95           ues:
96             separate (default), allAtOnce, singleFile
97
98       --single
99           Treats the package name as a filename.  The  file  must  contain  a
100           package recipe comment.
101
102       --force-remove
103           Deprecated option that does nothing.
104
105       --filter-versions
106           [Experimental] Filter version identifiers and debug version identi‐
107           fiers to improve build cache efficiency.
108
109   COMMON OPTIONS
110       See dub(1)
111

EXIT STATUS

113       0      DUB succeeded
114
115       1      usage errors, unknown command line flags
116
117       2      package not found, package failed to load, miscellaneous error
118

FILES

120       dub.sdl, dub.json
121

AUTHOR

123       Copyright (c) 1999-2023 by The D Language Foundation
124

ONLINE DOCUMENTATION

126       http://code.dlang.org/docs/commandline ⟨⟩
127

SEE ALSO

129       dub(1), dub-build(1), dub-dustmite(1), dub-lint(1), dub-run(1)
130
131
132
133The D Language Foundation         2023-07-24                       DUB-TEST(1)
Impressum