www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to run unit tests on Windows?

reply pineapple <meapineapple gmail.com> writes:
I've had success running unit tests on OSX by running `rdmd 
--main -unittest [file]` but have had no such luck on Windows. 
The aforementioned command fails, and `dmd [file] -main 
-unittest` seems to run the program without actually executing 
the unit tests.

Help?
Apr 14 2016
parent reply ag0aep6g <anonymous example.com> writes:
On 14.04.2016 12:39, pineapple wrote:
 I've had success running unit tests on OSX by running `rdmd --main
 -unittest [file]` but have had no such luck on Windows. The
 aforementioned command fails,
Should work. If you can go into more detail as to how it fails, maybe we can figure out what's wrong.
 and `dmd [file] -main -unittest` seems to
 run the program without actually executing the unit tests.
Invoked like that, dmd doesn't run the program at all. It just makes an .exe file of it. To run the program simply type its name into the command prompt. So if your source file is foo.d, `dmd foo.d -main -unittest` creates foo.exe, and you run it with `foo`.
Apr 14 2016
parent reply pineapple <meapineapple gmail.com> writes:
On Thursday, 14 April 2016 at 10:50:00 UTC, ag0aep6g wrote:
 Invoked like that, dmd doesn't run the program at all. It just 
 makes an .exe file of it. To run the program simply type its 
 name into the command prompt. So if your source file is foo.d, 
 `dmd foo.d -main -unittest` creates foo.exe, and you run it 
 with `foo`.
I'm haven't got access to my Windows PC at the moment, but that sounds like it will solve my problem. Thank you!
Apr 14 2016
parent jmh530 <john.michael.hall gmail.com> writes:
On Thursday, 14 April 2016 at 11:43:42 UTC, pineapple wrote:
 I'm haven't got access to my Windows PC at the moment, but that 
 sounds like it will solve my problem. Thank you!
Also, you can use rdmd on Windows if dmd is installed.
Apr 14 2016