[plt-scheme] Best way to run a bunch of test-suites with schemeunit?

From: Noel Welsh (noelwelsh at gmail.com)
Date: Sun Jun 17 13:10:19 EDT 2007

On 6/17/07, Grant Rettke <grettke at acm.org> wrote:
>
> How would I go about running each test case for each test file in a
> single pass at the console?
>

Ryan has told you how to combine test cases and suites into larger
suites.  I normally have a file called 'run-tests.ss' that contains
something like the following:

(require (planet "test.ss" ("schematics" "schemeunit.plt" 2)))
(require (planet "text-ui.ss" ("schematics" "schemeunit.plt" 2)))
(require "all-vb-tests.ss")

(test/text-ui all-vb-tests)

On the console I use the following command:

mzscheme -qev '(exit (load "run-tests.ss"))'

-----------

Aside: Various people (not naming names, but Robby) have requested a
feature that would automatically collect test cases into a default
test suite and automatically run them.  I've implemented a hacky
version of this, but to work properly it should transparently work
with all shortcuts.  Till recently I couldn't figure out how to do
this, but I recently had the thought that I could abuse #%module-begin
to set a parameter that has module level scope.  So it will happen
when I feel the impetus to implement it, and will mean you have to
write less code to construct test suites, at the cost of having less
flexibility over how tests are run.

N.


Posted on the users mailing list.