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

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Sat Jun 16 23:11:18 EDT 2007

On Sat, 2007-06-16 at 21:33 -0500, Grant Rettke wrote:
> Working on project Euler I've got a directory with a bunch of files
> layed out like this:
> 
> euler<#>.ss - The solution
> euler<#>-test.ss - The tests
> 
> The tests look like this:
> 
> (provide run test-cases)
> 
>   (define run
>     (λ ()
>       (test/graphical-ui test-cases)))
> 
>   (define test-cases
>     (test-suite
>      "Tests for euler2"
>      (test-equal? "fibsum million" (fibsum 1000000) 1089154)))
> 
> How would I go about running each test case for each test file in a
> single pass at the console?

You can aggregate test suites into another test suite. I generally have
a file called something like "all-tests.ss" that requires all the other
test modules and defines a test suite that contains all of the specific
test suites.

The schemeunit code itself collects all of its component tests into a
"super" test suite in the "all-schemeunit-tests.ss" file:

http://planet.plt-scheme.org/package-source/schematics/schemeunit.plt/2/8/plt/all-schemeunit-tests.ss

Ryan




Posted on the users mailing list.