[racket] running test-suites in module+ tests

From: Chad Albers (calbers at neomantic.com)
Date: Tue Aug 27 01:57:53 EDT 2013

Thanks.  I swear I tried that, and I couldn't get it to work.

It's a bit awkward, though, because of the mixed output.  "raco test"
has a very simplied (and parseable) test output.   Mixing it with
(run-tests) has a mixed output.  On failure, (run-test) gives the
number of tests failed.  And then depending on the verbosity setting
of (run-test), I get even more output.  If I decide to automate my
test suite, that adds a new layer of complication. I'm still working
out my guard-rackunit plans (if I have any).

Chad
--
Chad Albers


On Sun, Aug 25, 2013 at 11:47 AM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
>
> Does this help:
>
>> #lang racket
>>
>> (module+ test
>>   (require rackunit))
>>
>> ;; ---
>>
>> (module+ test
>>   (define-test-suite for-f
>>     (check-equal? (f 10) 10)
>>     (check-equal? (f 11) 12)))
>>
>> (define (f x)
>>   x)
>>
>>
>> (module+ test
>>   (require rackunit/text-ui)
>>   (run-tests for-f))
>
>
>
> On Aug 24, 2013, at 10:39 PM, Chad Albers wrote:
>
>> Hi,
>>
>> I'm exploring rolling my tests into the source files they cover using
>> the (module+ test...) form.
>>
>> Can I include (test-suite ...) statements in the module, and if so,
>> how do I get it to work?  I've haven't managed to get it to work with
>> raco test.
>>
>> Thanks,
>> --
>> Chad
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users
>

Posted on the users mailing list.