[racket] Can `raco test ...' return non 0 values?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Mar 20 13:49:02 EDT 2013

On Wed, Mar 20, 2013 at 11:14 AM, Diogo F. S. Ramos <diogofsr at gmail.com> wrote:
> What I'm thinking about is something more subtle than that.
>
> All the tests should be checked, even if some fail, but if some fail,
> there is a non-0 value returned.
>
> This is nice to have when you're automating tests so you don't have to
> visually check for errors.
>
> Is this possible?
>
> As a "test" module using "rackunit" always returns 0 I presume that
> making this change, if it's actually possible, won't break stuff.

Implementing this change in rackunit would be difficult. Currently
rackunit tests are modular and disconnected from one another. What you
are imagine requires the "last one" (in this file? in this call to
raco test?) to see if any of the others beforehand had a problem and
exit with non-0 if they did.

If you want to write a different program, then something like the
existing rackunit/text-ui might be appropriate, where it gets a tree
of non-modular tests and does some analysis on the result of
everything. I personally find this form of rackunit usage to be a pain
to deal with and prefer the modular approach.

Jay

--
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.