UnitTest and visual D

Kevin Cox kevincox.ca at gmail.com
Thu Feb 23 18:38:43 PST 2012


I am having the same problem with visual d plugin for monodevelop.  When I
compile from the command line the tests run.

A possibly related problem is that some files do not get recompiled when
changed unless I do a rebuild.
On Feb 23, 2012 8:38 PM, "Jonathan M Davis" <jmdavisProg at gmx.com> wrote:

> On Friday, February 24, 2012 02:11:50 Chris Pons wrote:
> > I am following the book "The D Programming Language" and am at
> > the portion about functions and unittest. For some reason I
> > cannot get unittest to do anything noticeable.
>
> If the unit tests pass, they don't print anything unless you add
> statements to
> them which do. You only get stuff being printed out on failure. This works
> particularly well for the command line (it's normal in Unix-land for stuff
> to
> print nothing on success unless them printing stuff out is their job - this
> makes it easier to pipe programs and the like). Some people complain about
> it
> from time to time, but that's the way it is. If you really want them to
> print
> something though, you can always add your own print statements.
>
> If you compiled with -unittest, the unit tests run before main does, so if
> all
> of your tests pass, then your program will run normally after the unit
> tests
> have been run.
>
> It's not uncommon for people to do something like this so that they can
> have
> the unit tests run without running their actual program:
>
> version(unittest) void main() {}
> else void main()
> {
>  //Your normal main...
> }
>
> - Jonathan M Davis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120223/a3ffa3bc/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list