How to run only one chosen unittest
Mike Parker
aldacron at gmail.com
Tue Dec 16 10:57:30 UTC 2025
On Tuesday, 16 December 2025 at 10:40:34 UTC, madwebness wrote:
> Been banging my head with ChaptGPT on this one, it just
> couldn't figure it out how to run only a particular unittest
> with `dub test`, so I have to ask.
>
There's no way to run individual tests with the vanilla framework
that I'm aware of. You can run the tests in individual modules by
invoking the compiler directly with the given source file, e.g.,
`dmd -c -unittest foo.d`.
unit-threaded gives you the ability to name tests and run them
individually:
https://code.dlang.org/packages/unit-threaded
Other third-party packages may do the same.
More information about the Digitalmars-d-learn
mailing list