something at something.com
Mon Apr 20 20:19:49 UTC 2020
On Friday, 17 April 2020 at 16:56:57 UTC, Russel Winder wrote:
> Thinking of trying to do the next project in D rather than
> Rust, but…
> Rust has built in unit testing on a module basis. D has this so
> no problem.
> Rust allows for integration tests in the tests directory of a
> project. These are automatically build and run along with all
> unit tests as part of "cargo test".
> Does D have any integrated support for integration tests in the
> Rust does?
D does not recognise any special testing directories afaik. But
you'll get the same affect as in rust if you have your
integration tests in a file that is not the modules you are
testing and run it after building the main library - or during
With Dub it's quite easy to set up, you can see the optional
package as an example . There's a tests directory that does
not have access to the optional package's internals. There's also
a unittest-compat configuration in dub.json that tests the
package alongside vibed (another d package)
For auto mocking, the only thing I've see that provides some
functionality is the unit-threaded package. But I've never tried
More information about the Digitalmars-d-learn