D project structure

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Wed Mar 26 13:08:07 PDT 2014


On 26/03/14 17:12, Russel Winder wrote:
> The Dub recommended structure doesn't mention test code as opposed to
> application/library source code, is it the case that the assumption is
> that all tests are in the modules using built-in unittest and that there
> are never any external tests?

I don't think there's anything about dub that stops you having arbitrary build 
targets in arbitrary directories, so you could readily place the source for a 
test application (or multiple applications) in different directories.

This is what I did in my first project to use Dub:
https://github.com/WebDrake/Dgraph/blob/master/package.json

The programs in the subdirectories of util/ are individual test programs -- in 
this case benchmarks, but you could readily extend the idea.

In my particular case I think it'd probably have been better just to directly 
specify the exact source files for each app, which is almost certainly possible, 
I just didn't do it ;-)  But this approach seems a good one for more complex 
test applications that are effectively whole projects in their own right.



More information about the Digitalmars-d-learn mailing list