Integration tests

Jon Degenhardt jond at
Fri Apr 17 17:51:44 UTC 2020

On Friday, 17 April 2020 at 16:56:57 UTC, Russel Winder wrote:
> Hi,
> 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 
> way
> Rust does?

Automated testing is important, perhaps you describe further 
what's needed? I haven't worked with Rust test frameworks, but I 
took a look at the description of the integration tests and unit 
tests. It wasn't immediately obvious what can be done with the 
Rust integration test framework that cannot be done with D's 
unittest framework.

An important concept described was testing a module as an 
external caller. That would seem very be doable using D's 
unittest framework. For example, one could create a set of tests 
against Phobos, put them in a separate location (e.g. a separate 
file), and arrange to have the unittests run as part of a CI 
process run along with a build.

My look was very superficial, perhaps you could explain more.

More information about the Digitalmars-d-learn mailing list