linkrope / dunit

xUnit Testing Framework for D
Boost Software License 1.0
37 stars 9 forks source link

Create folder(s) for report argument #15

Closed andre2007 closed 6 years ago

andre2007 commented 6 years ago

While passing a file path via console argument "report" there is an exception thrown if the folder does not exist.

dub test -- --report results/junit.xml

Could you create the folder(s) instead of throwing an exception?

linkrope commented 6 years ago

This behavior is based on the UNIX style:

$ mv foo bar/foo
mv: cannot move 'foo' to 'bar/foo': No such file or directory

The dmd itself supports both approaches:

In our build file, it was easy enough to add a dependency on the directory. So, the build tool creates the directory for the test report (as well as for the object files and the dependencies).

On the other hand, the standard library already provides std.file.mkdirRecurse. If you create pull request, I will accept it.

andre2007 commented 6 years ago

I created pull request #16. Could you also check whether you can provide a new release? Thanks a lot.